khajavi / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

Slow parsing on lists of references #182

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run pandoc html_refs.slow
2.
3.

What is the expected output? What do you see instead?

The program runs for an unexpectedly long time. I believe it is during 
parsing of the references. A workaround is to add blank lines between the 
references.

What version of the product are you using? On what operating system?

pandoc 1.2.1 on Linux/x86. Problem also exists in pandoc 1.0 and pandoc 
0.46.

Please provide any additional information below.

Original issue reported on code.google.com by noval...@gmail.com on 29 Nov 2009 at 3:13

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the report.  This is actually related to Issue #181, which came in 
around
the same time.  The reason pandoc takes so long to parse your input is that link
references are defined as sequences of inline elements between [].  One kind of
inline element is emphasized text, which starts with a _ character... So pandoc 
is
getting screwed up by the _'s in your links.

What I would do is use backticks to make these link labels "literal":  e.g.

[`ALLEGRO_FS_ENTRY`]: fshook.html

This will have two advantages:  (1) the label will appear in a monospaced "code"
font, and (2) internal _'s will not be interpreted as starting emphasized text. 
 This
change will also fix the slowdown problem.

Still, I'd like to avoid exponential speedups, even if there is a way to work 
around
them.  Something needs to be done about the emphasized/strong algorithm.

Original comment by fiddloso...@gmail.com on 29 Nov 2009 at 8:36

GoogleCodeExporter commented 9 years ago
Note that using the backticks will also prevent unwanted italics.
Changing to Priority-Low because I don't know how to avoid this slowdown at the
moment, other than by using backticks as suggested above.

Original comment by fiddloso...@gmail.com on 5 Dec 2009 at 5:15

GoogleCodeExporter commented 9 years ago
Fixed in c66921f2acea456af527b93e2daa1d8594798642.

Original comment by fiddloso...@gmail.com on 7 Dec 2010 at 6:14