Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: fix for (gr)log2html


From   Nikos Askitas <[email protected]>
To   [email protected]
Subject   st: fix for (gr)log2html
Date   Mon, 12 Jan 2009 11:21:59 +0100

I just joined the list so I hope  I am doing this right.

I recently needed an integrated quick pdf report of stata analysis together with graphs to communicate to my coauthor and came across grlog2html. I did the necessary
code archeology handpicking and fixing the code from here
http://www.stata.com/statalist/archive/2006-05/msg00656.html
and after one or two successful test runs it died on me with the unbalanced quotes error.

I am writing because of this post below (do2htm mentioned therein appears to inherit the problem)

http://www.stata.com/statalist/archive/2008-11/msg00723.html

I fixed the problem for me. The code is below.
I added the fix right before the comment line "// catch continuation lines". What it does is it substitutes any of ` { and " with their html codes. I suppose this avoids the "inadequate stata code" in log2html or grlog2html which must be somewhere afterwards and is responsible for the errors. My ideas was: if it is going to become html anyway we might as well html-ize
the "difficult" chars early on....

// fix
    local line: ///
 subinstr local line "`" "&#96;", all
    local line: ///
 subinstr local line "{" "&#123;", all
    local line: ///
 subinstr local line `"""' "&#34;", all
// fix
    // catch continuation lines

Nikos

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index