Comments (6)
I don't understand the question. Can you provide a simple test case and how you think it should be rendered?
from blackfriday.
Simply this in test.md:
# Hello
* hi
<pre>
<code>
# hi
fdfkfdl
</code>
</pre>
* ho
Nested pre, code tags with lists.
from blackfriday.
It works fine if you use the EXTENSION_LAX_HTML_BLOCKS
extension:
func TestRepro(t *testing.T) {
var tests = []string{
`* hi
<pre>
<code>
# hi
</code>
</pre>
* ho
`,
`<ul>
<li><p>hi</p>
<pre>
<code>
# hi
</code>
</pre></li>
<li><p>ho</p></li>
</ul>
`,
}
doTestsInlineParam(t, tests, Options{
Extensions: EXTENSION_LAX_HTML_BLOCKS,
}, 0, HtmlRendererParameters{})
}
Note: if you remove the Extensions: EXTENSION_LAX_HTML_BLOCKS,
line, the problem will reproduce just like you described.
from blackfriday.
Alternatively, this also works correctly, as per description in the original Markdown spec:
List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab
func TestRepro(t *testing.T) {
var tests = []string{
`* hi
<pre>
<code>
# hi
</code>
</pre>
* ho
`,
`<ul>
<li><p>hi</p>
<pre>
<code>
# hi
</code>
</pre></li>
<li><p>ho</p></li>
</ul>
`,
}
doTestsInlineParam(t, tests, Options{
//Extensions: EXTENSION_LAX_HTML_BLOCKS,
}, 0, HtmlRendererParameters{})
}
Note: I have indented "hi" to 4th column, all of the <pre>
block to 4th column, and added blank lines around the <pre>
block; no extension needed in this case.
I consider the issue closed.
from blackfriday.
Hey, so I've tried this thing with EXTENSION_LAX_HTML_BLOCKS and it didn't work for me, # hi
was still rendered as a header rather than code.
from blackfriday.
I just tried the above snippet and with latest code it still works as I described. Can you post yours?
from blackfriday.
Related Issues (20)
- Panic on listItem function HOT 1
- List after paragraph not rendenring HOT 1
- Is it possible to not wrap <div> inside <a> in <p>
- `AutoLink` becomes turned off when running with `HardLineBreak` ext
- How to support some UML plug-ins? For example: mermaid
- parse bitcoin uri's as links HOT 2
- List convert error HOT 1
- index out of range panic in v2.scanLinkRef (line 659 in markdown.go file)
- index out of range panic in v2.listItem (line 1369 in block.go file)
- code blocks break line has been deleted
- Buggy, fragile list behavior
- Column alignement in tables?
- What flags to (un)set if i want no header tags?
- Is v2 OK with Go 1.17?
- enclosed parentheses in markdown links not rendered properly in html
- Support single dash table define
- Is this repository dead? HOT 1
- Code blocks not parsed correctly
- Empty data while parsing markdown
- panic: block input is missing terminating newline
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.