Mercurial > octave
changeset 22685:b8c5280be6ad stable
__publish_html_output__.m: Ensure </span> in any case in syntax highlighting.
author | Kai T. Ohlhus <k.ohlhus@gmail.com> |
---|---|
date | Fri, 28 Oct 2016 14:32:12 +0200 |
parents | ce0f54b63923 |
children | d7c1263ea850 |
files | scripts/general/private/__publish_html_output__.m |
diffstat | 1 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/private/__publish_html_output__.m Thu Oct 27 17:57:59 2016 -0700 +++ b/scripts/general/private/__publish_html_output__.m Fri Oct 28 14:32:12 2016 +0200 @@ -244,7 +244,7 @@ ## Single quoted string elseif (strcmp (str(i), "'")) plh_str = "<span class=\"string\">'"; - i++; + i = i + 1; while (i <= length(str)) ## Ignore escaped string terminations if (strncmp (str(i:end), "''", 2)) @@ -252,42 +252,42 @@ i = i + 2; ## Is string termination elseif (strcmp (str(i), "'")) - plh_str = [plh_str, "'</span>"]; - i++; + plh_str = [plh_str, "'"]; + i = i + 1; break; ## Is string termination by line break elseif (strcmp (str(i), "\n")) - plh_str = [plh_str, "</span>"]; break; ## String content else plh_str = [plh_str, str(i)]; - i++; + i = i + 1; endif endwhile + plh_str = [plh_str, "</span>"]; plh = plh + 1; placeholder_cstr{plh} = plh_str; outstr = [outstr, " PUBLISHPLACEHOLDER", num2str(plh), " "]; ## Double quoted string elseif (strcmp (str(i), "\"")) plh_str = "<span class=\"string\">\""; - i++; + i = i + 1; while (i <= length(str)) ## Is string termination if (strcmp (str(i), "\"") && ! strcmp (str(i - 1), "\\")) - plh_str = [plh_str, "\"</span>"]; - i++; + plh_str = [plh_str, "\""]; + i = i + 1; break; ## Is string termination by line break elseif (strcmp (str(i), "\n")) - plh_str = [plh_str, "</span>"]; break; ## String content else plh_str = [plh_str, str(i)]; - i++; + i = i + 1; endif endwhile + plh_str = [plh_str, "</span>"]; plh = plh + 1; placeholder_cstr{plh} = plh_str; outstr = [outstr, " PUBLISHPLACEHOLDER", num2str(plh), " "];