Comments (7)
As I have expressed elsewhere, CriticMarkup by it's very nature will not work properly when applied to the HTML output. It's a feature designed for writing, not formatting. The idea is that the user should accept/reject all changes before converting to HTML (e.g. "publishing").
In simple cases CriticMarkup and HTML output works properly, so MMD attempts to do this. But in more complex examples it generates invalid HTML. There's no way around this, without writing an extremely complex parser that understands what you meant to write, instead of what you did write.
from multimarkdown-4.
For the mark
-element I agree, that generating invalid HTML is probably 'too easy' (although by using pure HTML elements the user is responsible, not the tool), but for del
and ins
I don't see the reason. Maybe I wasn't clear enough, I didn't ask for a special syntactic handling, I only asked to avoid wrapping them in p
-tags if and only if these elements are alone on a single line like in:
A paragraph.
<del>
Another paragraph.
A second.
</del>
And another.
The reason behind resorting to HTML tags in my case is that
{--
Another paragraph.
A second.
--}
produces invalid nesting of elements (the same is true for {++ ++}
, {== ==}
and {>> <<}
).
For the pure HTML del
- and ins
-elements there is no need to to handle these elements with -a
or -r
(although it would be nice). MMD already doesn't wrap elements like for example aside
, section
, nav
and main
which have no meaning in MultiMarkdown, nevertheless I can use them, if I need to.
from multimarkdown-4.
May I ask an additional question regarding CriticMarkup? Is there a reason, why comments are never output to the HTML document? The CritcMarkup specification says that comments should be wrapped inside a <span class="critic comment"/>
span.
from multimarkdown-4.
Ahh.. I misunderstood your original question. ins
, del
, mark
are now recognized as HTML5 in latest commit.
As to the second.... CriticMarkup has two parts -- the syntax and how it is exported as HTML. The syntax is a great idea. How it is exported not so much (partially for the reasons as discussed above.)
MMD has built-in support for the CriticMarkup syntax, because I think it's a fabulous idea to allow collaborators to mark up the source text of a document with notes to each other (e.g. "Track Changes"). Even better is MultiMarkdown Composer's ability to compare two versions of a document and automatically generate the CM markup to convert one to the other.
I disagree with their approach to output, however. A comment in this context is not part of the output document. For example, the comment "Tom.... I really like this part!" would not be printed in the paperback copy of a book. It's comment intended for others writing and editing the book, not for those reading the book. Neither would strikethroughs, etc. The "expected" behavior for MultiMarkdown is either the -a
or the -r
option to generate the original, or the modified, version of a document.
They conflated two things --- the ability to annotate the source, and a means to provide additional markup to the output (e.g. highlights, strikethroughs, etc.) I like one of them (it's brilliant), but dislike the other (it needs work, and is much more complex than they thought when first creating this project, i.e. the difficulty in getting valid HTML output.) What MMD does currently when using -a
AND -r
is a bit of a compromise.
If you prefer the official CriticMarkup HTML output, then you can always use another CriticMarkup processor before passing the result through MultiMarkdown. Brett Terpstra has also done some interesting things with Marked in this regard.
from multimarkdown-4.
Thanks!
The use case you describe is exactly ours. We are using MultiMarkdown to create documents which are transformed via XSL and then are converted to PDF. Since we collaborate on the documents a lot CriticMarkup was really a welcome addition in MultiMarkdown. But sometimes we only exchange the PDF or even a printed version (based on HTML created with -a
and -r
) and we were missing the comments in this case because some people used the comments to explain why they proposed a deletion or addition.
Maybe it's worth thinking about a command line switch which enables output of comments to the document. The default behaviour as it is (e. g. ignore comments in output) is OK in my opinion, but maybe it should be documented.
Just to be curious, are you considering to support the syntax I used in my example in future versions, e. g.
{--
Another paragraph.
A second.
--}
?
Anyway, thanks again.
from multimarkdown-4.
I'll consider an option to pass comments through.
As to the example you use, it works with both the -a
and -r
options. Getting things to work with
-a -r
is up to you. That's what I've been saying -- CriticMarkup is not designed for HTML.
;)
from multimarkdown-4.
I'll try my very best to use it properly ;), thanks.
from multimarkdown-4.
Related Issues (20)
- MMD header key and value left in HTML head after conversion HOT 2
- Request: Include Paths to CLI HOT 8
- {{TOC}} Error with variables in a heading HOT 1
- Empty double quotes inside a table cell breaks layout HOT 1
- fancy lists (letters instead of numbers) HOT 1
- Removing comments HOT 3
- Special characters in metadata values/variables HOT 1
- Well formed HTML/XML with missing figure definition HOT 2
- Invalid XML/HTML with Markdown inside nested block element tags HOT 1
- ![Alt text](/path/to/img.jpg "Optional title") syntax currently broken HOT 1
- Reference labels should be case-insensitive HOT 1
- Support for rST-style Admonitions HOT 2
- Can I get line/column information from a node? HOT 5
- Incorrect works code blocks? HOT 3
- Can you add support strikethrough text? HOT 1
- Support for indexes HOT 3
- Custom Block Syntax HOT 3
- Ampersand in bibliographical references is not converted to &. HOT 1
- Problems with spaces after footnotes in .FODT output HOT 3
- Crashes while freeing a g_string HOT 12
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.
are wrapped intags
from multimarkdown-4.