From 69242948f7acf2a99a78c05808a18c9dc4d56674 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Fri, 24 Nov 2017 21:14:24 +0100 Subject: [PATCH] fixxref: fix vim syntax highlighting Update the vim command script. Also fix cutting out the highlighted part from the output. Fixes #787495 --- gtkdoc/fixxref.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtkdoc/fixxref.py b/gtkdoc/fixxref.py index 06464db..c5a8979 100755 --- a/gtkdoc/fixxref.py +++ b/gtkdoc/fixxref.py @@ -371,14 +371,14 @@ def HighlightSourceVim(options, type, source): # format source # TODO(ensonic): use p.communicate() - script = "echo 'let html_number_lines=0|let html_use_css=1|let html_use_xhtml=1|e %s|syn on|set syntax=%s|run! syntax/2html.vim|w! %s.html|qa!' | " % ( + script = "echo 'let html_number_lines=0|let html_use_css=1|let html_use_xhtml=1|e %s|syn on|set syntax=%s|run! plugin/tohtml.vim|run! syntax/2html.vim|w! out.html|qa!' | " % ( temp_source_file, options.src_lang, temp_source_file) script += "%s -n -e -u NONE -T xterm >/dev/null" % config.highlight subprocess.check_call([script], shell=True) highlighted_source = common.open_text(temp_source_file + ".html").read() - highlighted_source = re.sub(r'.*]*>\n', '', highlighted_source, flags=re.MULTILINE) - highlighted_source = re.sub(r'.*', '', highlighted_source, flags=re.MULTILINE) + highlighted_source = re.sub(r'.*]*>\n', '', highlighted_source, flags=re.DOTALL) + highlighted_source = re.sub(r'.*', '', highlighted_source, flags=re.DOTALL) # need to rewrite the stylesheet classes highlighted_source = highlighted_source.replace('', '') -- 2.11.4.GIT