Comments (5)
You want to disable parsing of block-level HTML entirely? You can simply define your own variant of defaultBlockSpecs
that leaves out the block HTML parser.
myDefaultBlockSpecs :: (Monad m, IsBlock il bl) => [BlockSpec m il bl]
myDefaultBlockSpecs =
[ indentedCodeSpec
, fencedCodeSpec
, blockQuoteSpec
, atxHeadingSpec
, setextHeadingSpec
, thematicBreakSpec
, listItemSpec (bulletListMarker <|> orderedListMarker)
-- , rawHtmlSpec -- <- leave this out!
, attributeSpec
]
If you want to parse raw HTML blocks, but just not ones that begin with <a34s...>
or whatever, then you can modify the block HTML parser.
from commonmark-hs.
Thanks.
If you want to parse raw HTML blocks, but just not ones that begin with <a34s...> or whatever, then you can modify the block HTML parser.
I suppose this is what I will end up doing. Though it would be nice if there is someway to override the angle-bracket link content parsing without modifying the library.
from commonmark-hs.
You don't actually have to modify the library. You can create your own myBlockHtmlSpec
that just modifies the standard one a bit (this would only be a few lines of code, I think, because you can use the standard one in the definition), and use this instead of the default one n a custom myDefaultBlockSpecs
as above.
from commonmark-hs.
because you can use the standard one in the definition
Hmm, you mean I can reuse the rawHtmlSpec
function? I don't see how though, because it doesn't take any arguments. Actually I'm at the point of forking this function and disabling that ty == 7
case altogether ...
EDIT: I guess I could override blockStart
- but I'd still have to re-implement that part, and that startCond
func is not exported.
from commonmark-hs.
See my comment on your PR.
from commonmark-hs.
Related Issues (20)
- [fuzz result] what even is `[^]`? HOT 1
- [fuzz result] parser sees links with unbalanced `[]` inside
- [fuzz result] nested empty list with two trailing blank lines causes the outer list to be parsed as loose
- [fuzz result] footnote definition labels with blank lines are allowed HOT 1
- [fuzz result] unindented lines after footnote def are silently eaten HOT 6
- `commonmark-pandoc`: calculate relative cell widths for pipe tables HOT 11
- Tests fail with "Stack space overflow" on big endian systems HOT 1
- [fuzz result] Link def title trailing backslash
- Support for GitHub markdown alerts {Note, Important, Tip...} HOT 14
- [fuzzing result] deeply nested list with blank lines causes outer list to not parse as loose
- [fuzz result] code span vanishes when link destination is ` HOT 5
- [fuzz result] [commonmark-pandoc] footnotes in footnotes HOT 3
- [fuzz result] inline processing instructions can't parse more than once in a block? HOT 2
- [fuzz result] HTML declaration blocks do not follow spec 0.30
- [fuzz result] counterintuitive list tightness
- Quadratic output size explosion with tables extension HOT 5
- gfm parsing oddity with links and raw HTML HOT 6
- GFM + Rebase relative paths incorrectly rebases URLs with Unicode characters HOT 1
- [fuzz result] backslashing `&` entities doesn't escape them in link destinations HOT 1
- autolink_bare_uris doesn't work correctly in 3.1.12.x for URLs with dot, comma, parenthesis etc. HOT 1
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 commonmark-hs.