Comments (5)
This one comes down to the first line having two opening tags and one close tag. The parser doesn't realise that the first tag isn't closed and that is what messes it up.
I've managed to get a patch working but I'll see if I can clean it up a bit before I submit a PR
from python-markdown2.
Current workaround is to make sure that there is a newline after the first starting div tag.
from python-markdown2.
Regarding the test for the fix, the unordered list at the end is important. The markdown renders correctly if you omit the unordered list.
In [1]: x = '''
...: <div><div></div>
...: </div>
...: <div></div>
...: <div></div>
...: <div></div>
...:
...: - A
...: '''
...: from markdown2 import markdown
...: print(markdown(x))
...:
<div><div></div>
</div>
md5-688f5ae04dff1a2c8b9235b8be711c7e
md5-688f5ae04dff1a2c8b9235b8be711c7e
md5-688f5ae04dff1a2c8b9235b8be711c7e
<ul>
<p><li>A</li>
</ul></p>
In [2]: x = '''
...: <div><div></div>
...: </div>
...: <div></div>
...: <div></div>
...: <div></div>
...:
...: '''
...: from markdown2 import markdown
...: print(markdown(x))
<div><div></div>
<p></div></p>
<div></div>
<div></div>
<div></div>
from python-markdown2.
Oh never mind, I see the test has the unordered list at the end. Sorry about that
from python-markdown2.
No worries! I had originally omitted it, assuming it was unimportant but realised the mistake
from python-markdown2.
Related Issues (20)
- Backslash at the end of a line for a newline
- base64 images links in safe mode become corrupted HOT 2
- Easy way to replace links to other markdown files to html files HOT 3
- Same header names generate identical HTML anchors HOT 1
- Footnotes in lists are numbered before other footnotes HOT 3
- Converting non-english anchor tags leads to "-x" values (or umlauts are replaced) HOT 2
- HTML headers not included in TOC
- Bad handling of two consecutive bold words HOT 6
- Fenced-code-blocks extra funky movments HOT 1
- Markdown Syntax Not Converted Within HTML Tags in markdown2 HOT 3
- Conversion Issue with Single Line Breaks in Lists and Tables HOT 2
- Table Conversion Issue with Trailing Spaces/Tabs
- Link Conversion Fails with Preceding or Following Square Brackets HOT 2
- Update markdown2 version on PyPI HOT 2
- Formatting error when input contains multiple words surrounded by triple asterisks HOT 2
- Conversion Issue with Single Line Breaks in Tables HOT 1
- Issue with Table Conversion - Last Row Not Converted HOT 1
- Update on PyPI and merge latest pull requests HOT 1
- Add typing to package HOT 3
- Unclosed HTML comments not being escaped with `safe_mode='escape'` HOT 3
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 python-markdown2.