public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Possible bug (non-escaped $). Should Pandoc escape $'s when going html->pandoc-markdown?
@ 2012-04-15 15:37 John Gabriele
       [not found] ` <CAO9PwMXG_j8YQO5233oQvD8ZEoZbmoQbHNQupjn1aaySKSjmfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: John Gabriele @ 2012-04-15 15:37 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Hi,

If I process the following:

~~~
**$\*OPTS** *[special var](foo.html#bar)*
options from command line

**$\*OUT** *[special var](foo.html#baz)*
standard output (command line mostly), see also
**[$\*IN](#moo)**
~~~

The output contains 2 errors in the 2nd paragraph: one regarding
$\*OUT, and the other regarding $\*IN.

If I backslash escape *only* the $ in the very last line, it fixes
both output errors. Likewise, if I backslash-escape *only* the $ in
$\*OUT, that also fixes *both* output errors.

I ran into this when converting some html to pandoc-markdown, where
Pandoc does not backslash-escape $'s.

Should Pandoc escape $'s when converting html to pandoc-markdown?

Thanks,
---John


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Possible bug (non-escaped $). Should Pandoc escape $'s when going html->pandoc-markdown?
       [not found] ` <CAO9PwMXG_j8YQO5233oQvD8ZEoZbmoQbHNQupjn1aaySKSjmfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-04-15 16:04   ` John Gabriele
       [not found]     ` <CAO9PwMWD7hYCovu4ArqD_WU865wo5tVy7yiabJAXDB5uuAFEQA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: John Gabriele @ 2012-04-15 16:04 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Similarly, if I've got the following html (in file foo.html):

~~~
<p>hi &lt;foo bar baz&gt; bye</p>
<p>hi <em>&lt;foo bar baz&gt;</em> bye</p>
<p>hi <strong>&lt;foo bar baz&gt;</strong> bye</p>
~~~

and I convert it to pandoc-markdown (via `pandoc -o foo.txt foo.html),
I get this:

~~~
hi <foo bar baz\> bye

hi *<foo bar baz\>* bye

hi **<foo bar baz\>** bye
~~~

(Note that pandoc has only backslash-escaped the closing angle
brackets, not the opening ones.)

Now, if I then try to convert that back to html (`pandoc -o foo2.html
foo.txt`), I get this:

~~~
<p>hi <foo bar baz\> bye</p>
<p>hi <em><foo bar baz\></em> bye</p>
<p>hi <strong><foo bar baz\></strong> bye</p>
~~~

(where I was expecting what I had to start with: I wanted &lt; and
&lt; in there.)

If I add in (to the pandoc-markdown file) the backslash-escapes myself, like so:

~~~
hi \<foo bar baz\> bye

hi *\<foo bar baz\>* bye

hi **\<foo bar baz\>** bye
~~~

and convert that to html, I get the correct output.

When Pandoc is converting html->pandoc-markdown, should it be escaping
*all* the angle brackets (not just the closing ones)? It would seem to
be the case.

Thanks,
---John


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Possible bug (non-escaped $). Should Pandoc escape $'s when going html->pandoc-markdown?
       [not found]     ` <CAO9PwMWD7hYCovu4ArqD_WU865wo5tVy7yiabJAXDB5uuAFEQA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-04-15 18:06       ` fiddlosopher
  0 siblings, 0 replies; 3+ messages in thread
From: fiddlosopher @ 2012-04-15 18:06 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

On Sunday, April 15, 2012 9:04:39 AM UTC-7, John Gabriele wrote:
>
> When Pandoc is converting html->pandoc-markdown, should it be escaping
> *all* the angle brackets (not just the closing ones)? It would seem to
> be the case.
>
> Yes, probably so.   I've made the change (for < > and $).

Note, however, that there are still other cases where you can get unwanted 
results.  '[' is not escaped, for example.  But escaping it would cause 
problems with citations, the way they are currently handled.  I think that 
in practice, problems will be very rare.


-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pandoc-discuss/-/axCAds3t_QMJ.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at http://groups.google.com/group/pandoc-discuss?hl=en.


[-- Attachment #2: Type: text/html, Size: 1412 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-15 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-15 15:37 Possible bug (non-escaped $). Should Pandoc escape $'s when going html->pandoc-markdown? John Gabriele
     [not found] ` <CAO9PwMXG_j8YQO5233oQvD8ZEoZbmoQbHNQupjn1aaySKSjmfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-15 16:04   ` John Gabriele
     [not found]     ` <CAO9PwMWD7hYCovu4ArqD_WU865wo5tVy7yiabJAXDB5uuAFEQA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-15 18:06       ` fiddlosopher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).