Comments (5)
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.
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.
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.
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.
> 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)
- title element not escaped
- Problem with auto email links
- Add link to Pagedown on the project home page. HOT 1
- Allow to set base url for relative url
- URL detection bug for URLs that contain parentheses
- f3973492a27c breaks ConfigTest.TestEncodeProblemUrlCharacters
- Enable EmailEncoding as an option HOT 1
- <code> tags are rendered inside of <pre> for code blocks
- Add option to avoid Paragraph around single element
- Support Pandoc Extensions to Markdown
- Add Strikethrough
- Have the option to add a prettify class name to the <pre> tags
- URL: Support protcol-relative URLs
- Auto-URLs are breaking with any url that has an underscore HOT 1
- Strange <p> tag placement
- Unit test error: MarkdownSharpTests.ConfigTest.TestEncodeProblemUrlCharacters HOT 1
- AutoNewlines set through MarkdownOptions replaces EOL with <br instead of <br />
- Add SkipCodeBlocks Option HOT 1
- Migrate to GitHub! HOT 1
- Sponsor an official nuget package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdownsharp.