Comments (3)
Actually, Span is an inline element. What you probably want to use is a Div, which is actually a block.
You can also check this in the Pandoc internals. Main inlines are:
data Inline
= Str String -- ^ Text (string)
| Emph [Inline] -- ^ Emphasized text (list of inlines)
| Strong [Inline] -- ^ Strongly emphasized text (list of inlines)
| Strikeout [Inline] -- ^ Strikeout text (list of inlines)
| Superscript [Inline] -- ^ Superscripted text (list of inlines)
| Subscript [Inline] -- ^ Subscripted text (list of inlines)
| SmallCaps [Inline] -- ^ Small caps text (list of inlines)
| Quoted QuoteType [Inline] -- ^ Quoted text (list of inlines)
| Cite [Citation] [Inline] -- ^ Citation (list of inlines)
| Code Attr String -- ^ Inline code (literal)
| Space -- ^ Inter-word space
| SoftBreak -- ^ Soft line break
| LineBreak -- ^ Hard line break
| Math MathType String -- ^ TeX math (literal)
| RawInline Format String -- ^ Raw inline
| Link Attr [Inline] Target -- ^ Hyperlink: alt text (list of inlines), target
| Image Attr [Inline] Target -- ^ Image: alt text (list of inlines), target
| Note [Block] -- ^ Footnote or endnote
| Span Attr [Inline] -- ^ Generic inline container with attributes
While main blocks are:
data Block
= Plain [Inline] -- ^ Plain text, not a paragraph
| Para [Inline] -- ^ Paragraph
| LineBlock [[Inline]] -- ^ Multiple non-breaking lines
| CodeBlock Attr String -- ^ Code block (literal) with attributes
| RawBlock Format String -- ^ Raw block
| BlockQuote [Block] -- ^ Block quote (list of blocks)
| OrderedList ListAttributes [[Block]] -- ^ Ordered list (attributes
-- and a list of items, each a list of blocks)
| BulletList [[Block]] -- ^ Bullet list (list of items, each
-- a list of blocks)
| DefinitionList [([Inline],[[Block]])] -- ^ Definition list
-- Each list item is a pair consisting of a
-- term (a list of inlines) and one or more
-- definitions (each a list of blocks)
| Header Int Attr [Inline] -- ^ Header - level (integer) and text (inlines)
| HorizontalRule -- ^ Horizontal rule
| Table [Inline] [Alignment] [Double] [TableCell] [[TableCell]] -- ^ Table,
-- with caption, column alignments (required),
-- relative column widths (0 = default),
-- column headers (each a list of blocks), and
-- rows (each a list of lists of blocks)
| Div Attr [Block] -- ^ Generic block container with attributes
| Null -- ^ Nothing
from panflute.
Thanks! Plain
instead of Para
works but Div
does not accept the Str
inline element, so I have to make sure that all children of Div
are of type block, right? Are there any shortcuts!
Just one more question! Is it possible to apply a filter and leave the rest of the document untouched.
For example
> lazy quotes
line 2
line 3
is changed to
> lazy quotes
> line 2
> line 3
I want to avoid that, I want write a filter from markdown to markdown, which should only insert numbering and leave everything else untouched
from panflute.
so I have to make sure that all children of Div are of type block, right?
You are right.
If you check the quoted code in my previous comment, Plain [Inline]
means that Plain contains lists of inlines. So you can put a Str inside a Plain. However, Div can only store other blocks.
from panflute.
Related Issues (20)
- stringify bug with Cite
- Nav and other HTML5 elements missing
- How to skip a table? HOT 2
- Creating a Table without a Caption produces error HOT 1
- Creating a Panflute filter that interacts with other filters HOT 1
- Reimplement the panflute.stringify with native pandoc writer HOT 2
- Unable to get Panflute filter comments.py to work correctly HOT 1
- Add comparison method to Element class? HOT 2
- Compatibility with Pandoc 2.18 HOT 3
- Using panflute as a writer rather than a filter HOT 8
- Stringifying the terms of a definition list results in AttributeError HOT 7
- Hwo to use the span method? HOT 1
- Applying panflute filter multiple times generates an unexpected result
- Can't convert markdown style citations to LaTeX style using panflute filter HOT 5
- Navigation with next and prev unstable HOT 3
- Add space before footnote in stringify function HOT 4
- Is there solution to add custom style for lists with panflute ? HOT 2
- Avoid side-effects in walk
- Figure, Table: to_json() crashes if caption is None HOT 1
- Reading the value of `--resource-path` inside a panflute filter ? 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 panflute.