On 13/09/11 06:05, Pavel Shramov wrote:
I was working on scripts to embed png images for latexmath formulas and hit
strange
bug. I've added custom rule for latexmath-inlinemacro.
[latexmath-inlinemacro]
<span class="latexmath">
<img src="{eval:open('/tmp/file', 'w').write("""{passtext}""")}"
alt="{passtext}"/>
</span>
And here is example document
Test
====
== Formula
latexmath:[$ \frac{1}{ ( 100ns * ( pulse-width + pulse-space-min )) } $]
In /tmp/file i've got \x070\x07 (three chars, '0' in the middle, \x07 on sides).
eval may be replaced by sys, sys2 and i'm getting same result - \x070\x07...
Probably I'm doing something wrong but have not found what...
The problem is because internally AsciiDoc processes passthroughs by replacing
the passthrough text with temporary \x07<integer>\x07 placeholders which are
later replaced with the actual passthrough text when all substitutions have been
processed.
The use of \x07 is to ensure unique temporary placeholders, which works because
\x07 characters will never be encountered internally in AsciiDoc source
(AsciiDoc expands tabs to spaces when it reads the source text).
What's happening here is that your macro is being executed after insertion of
the temporary passthrough placeholders but before asciidoc has had a chance to
put the actual passthrough text back into the output.
Cheers, Stuart
Versions are debian 8.5.2 and 8.6.3
Pavel
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.