1 |
commit: 3db08691f11a7e6e823120073b11bd578acec57e |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 11 21:29:48 2019 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 11 21:29:48 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=3db08691 |
7 |
|
8 |
Makefile: Change encoding of HTML file to UTF-8. |
9 |
|
10 |
This will allow to drop the dependency on app-text/recode. |
11 |
|
12 |
Replace ligatures in tex4ht output by their components, because they |
13 |
would interfere with text search. Update sed expression for the list |
14 |
of tables workaround. |
15 |
|
16 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
17 |
|
18 |
Makefile | 16 ++++++++-------- |
19 |
1 file changed, 8 insertions(+), 8 deletions(-) |
20 |
|
21 |
diff --git a/Makefile b/Makefile |
22 |
index 5359342..612af4c 100644 |
23 |
--- a/Makefile |
24 |
+++ b/Makefile |
25 |
@@ -44,20 +44,20 @@ pms.dvi: $(LATEXFILES) pms.bbl $(COMMITINFO) |
26 |
pms.html: $(LATEXFILES) pms.bbl $(COMMITINFO) |
27 |
set -e; sum=''; \ |
28 |
while true; do \ |
29 |
- mk4ht xhlatex pms xhtml,fn-in; \ |
30 |
+ mk4ht xhlatex pms 'xhtml,fn-in,charset=utf-8' ' -cunihtf -utf8'; \ |
31 |
oldsum=$${sum}; sum=$$(cksum $@); \ |
32 |
test "$${sum}" != "$${oldsum}" || break; \ |
33 |
done |
34 |
- @# some www servers ignore meta tags, resulting in a wrong charset. |
35 |
- @# therefore recode the very few non-ascii characters |
36 |
- recode -d l1..h3 $@ |
37 |
- @# declare encoding as utf-8, although it is pure ascii |
38 |
- LC_ALL=C sed -i -e '/<?xml\|<meta/s/iso-8859-1/utf-8/' $@ |
39 |
+ @# replace ligatures by their component letters |
40 |
+ LC_ALL=C sed -i "$$(printf 's/\\xef\\xac\\x8%s/%s/g;' \ |
41 |
+ 0 ff 1 fi 2 fl 3 ffi 4 ffl)" $@ |
42 |
@# work around irregularity in how links to longtables are |
43 |
@# formatted in the List of Tables |
44 |
- LC_ALL=C sed -i -e '/<span class="lotToc" > /{N;N;s/\( <a \nhref="[^"]\+">\)\([0-9A-Z.]\+\)[ \n]\+/\2\1/}' $@ |
45 |
+ LC_ALL=C sed -Ei '/<span class="lotToc" *>\B/{N;N;'\ |
46 |
+ 's/([^>]*<a\s+href="[^"]+">)([0-9A-Z.]+)\s+/\2\1/;}' $@ |
47 |
@# remove redundant span elements |
48 |
- LC_ALL=C sed -i -e ':x;/<span\(\s\+[^>]*\)\?$$/{N;bx;};:y;s/\(<span\s\+[^>]*>\)\([^<]*\)<\/span>\1/\1\2/;ty' $@ |
49 |
+ LC_ALL=C sed -Ei ':x;/<span(\s+[^>]*)?$$/{N;bx;};'\ |
50 |
+ ':y;s,(<span\s+[^>]*>)([^<]*)</span>\1,\1\2,;ty' $@ |
51 |
|
52 |
pms.bbl: pms.bib $(LATEXFILES) $(COMMITINFO) |
53 |
$(aux-clean) |