Re: [Patch] Improve replying to html-only messages

Albrecht Dreß <[email protected]>
Newsgroups gmane.comp.gnome.apps.balsa
Message-ID <[email protected]>
Am 20.01.18 16:11 schrieb(en) Albrecht Dreß:
> attached is a little patch which improves replying to html-only messages containing national characters.  It turns out that html2markdown reliably converts such characters to utf-8 only if an extra command line option is given.  As we check for a “zoo” of conversion tools, the configure script verifies that the selected one does actually accept the extra option.
> 
> Unfortunately, I have no idea how the change should be added to the meson build, so it would be great if someone could have a look at it.

O.k., this seems to be a little complex, as I did not find a way to simply create and erase a file from meson.  The recommended (?) way seems to be writing a shell script for that purpose…  not really portable!  Anyone knows a better way?

The meson part is then simple.  Attached is patch which shall go on top of the first one, and /should/ detect if the extra command line option is accepted.  Unfortunately, I can not build the result, as Ninja is too old on Ubuntu LTS.

Cheers,
Albrecht.

_______________________________________________
balsa-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/balsa-list
html_reply_conversion_meson.diff (text/x-patch, 881 B)
diff --git a/check_htmlconv.sh b/check_htmlconv.sh
new file mode 100755
index 0000000..a7c26e5
--- /dev/null
+++ b/check_htmlconv.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+echo "<html/>" > conftest.htm
+$@ conftest.htm
+R=$?
+rm -f conftest.htm
+exit $R
+
diff --git a/meson.build b/meson.build
index c6fc2ae..4cc3a88 100644
--- a/meson.build
+++ b/meson.build
@@ -218,6 +218,11 @@ elif html_widget == 'webkit' or html_widget == 'webkit2'
   if html2text.found()
     conf.set_quoted('HTML2TEXT', html2text.path(),
       description : 'Path to html2text program.')
+    r = run_command('check_htmlconv.sh', html2text.path(), '--unicode-snob')
+    if r.returncode() == 0
+      conf.set('HTML2TEXT_UCOPT', 1,
+        description : 'Defined when the HTML converter accepts the --unicode-snob option.')
+    endif
   else
     message('You cannot properly quote html-only messags.')
   endif
signature.asc (application/pgp-signature, 473 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAABCAAGBQJaajs9AAoJEEypbw5n59n4tkQH/3eYSzp0M5P++gEEyPUT5IPQ
GEYSVU+g8Ss4CWzCc3agPrLm9ztPKnN7pX8FwV7FQRNlrYHrhjBBIN4a+M5IFTQy
S593sP9i4rPHS27IybXWE0L4VLgu/wCC+gxpjAqbtgHpBHIHs4o/uEakXZ4tNHjK
oLRSkb1OMzYNUFgJX5gGLkr8uaNQ+Q0Uiq7fBS7XpICO2S3r4Gd63eED+owkDl54
V5PnTMG8ojxMlS3l4LHs0ya6zgOOVklT5R3ppgkCLUx4Qu/to1tyFoTG6OOV34k7
FFgZYuH6SXei4ARHDs4EE8T78tdHz8ScKyEx2/qtl6JF09rli1v9ORN5HN4wUAg=
=3Jzw
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.