Giter Club home page Giter Club logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 24, 2024
Well, I set the php nestdepth to 6 like it is in MarkdownSharp, and then 
printed out
both the patterns after construction, with all whitespace normalized to a single
space. As far as I can see the only difference between the two was that .cs was 
using
\2 in some places where php is using \3. The error was that these two lines:

            pattern = pattern.Replace("$content", content);
            pattern = pattern.Replace("$content2", content2);

Should be the other way around

            pattern = pattern.Replace("$content2", content2);
            pattern = pattern.Replace("$content", content);

Because if you first replace $content, that will also replace $content2, since
$content is a substring of $content2. Changing these two lines around and 
comparing
again it seemed that the patterns were exactly identical between php and cs. 
And so,
assuming that PHP works, then the CS version should work as well.

Original comment by [email protected] on 6 Jan 2010 at 9:22

Attachments:

from markdownsharp.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 24, 2024
ah, excellent! thank you. I totally missed that.

Unfortunately, the corrected regex still results in 2 failing tests, in 
slightly 
disturbing ways. It looks like the PHP version has some additional logic around 
blocks, determining which ones get wrapped in <p> and which ones do not. 

:(


Original comment by [email protected] on 6 Jan 2010 at 9:59

from markdownsharp.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 24, 2024
Well, it seems that one of the new failing tests, the ordered/unordered lists 
one
that wraps <hr /> in a <p> fails because there is too much trimming of lines 
after
the lists. At one point you have

[some list]
[blank line]
<hr />

But then after the list is processed the blank line before <hr /> goes away so 
we have

[processed list]
<hr />

which makes the block regex not match it since it requires blocks to have an 
empty
line above. So maybe adding a newline after a list, at least a top level list, 
might
fix that. Or just hacking it afterwards by putting a \n before any <hr> that 
doesn't
have a preceding blank line.

Original comment by [email protected] on 6 Jan 2010 at 10:13

from markdownsharp.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 24, 2024
well, I have a different hack checked in now -- along with the new 
HashHTMLBlocks()
routine!! Thanks a million for your help on that.

The Unwrappable() is kind of nasty, maybe take a look and see if you have any 
better
ideas. But Unwrappable() seems mostly safe to me, if unpleasant..

Original comment by [email protected] on 6 Jan 2010 at 10:56

  • Changed state: Fixed

from markdownsharp.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 24, 2024
>  So maybe adding a newline after a list

Yes, that was the fix -- pretty subtle, but in ListItemEvaluator() ...

item = RunBlockGamut(Outdent(item) + "\n");

Original comment by [email protected] on 7 Jan 2010 at 3:47

from markdownsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.