-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update and expand line breaks FAQ #7
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,11 +189,47 @@ $ git diff --word-diff | |
<dt>How do I force a line break?</dt> | ||
<dd> | ||
|
||
You can add a hard line break with the `<br/>` element. | ||
Although CommonMark and other lightweight markup languages | ||
allow trailing spaces to indicate breaks between consecutive lines, | ||
this syntax is incompatible with | ||
editors that automatically strip trailing whitespace. | ||
Some lightweight markup languages provide a dedicated syntax for line breaks, | ||
some support line breaks using the inline HTML element `<br>`\*, | ||
and some do both. | ||
|
||
<dl> | ||
|
||
<dt>AsciiDoc</dt> | ||
<dd>**Syntax**: A trailing space followed by a plus sign (`+`)</dd> | ||
<dd>**Inline HTML**: Not supported</dd> | ||
|
||
<dt>CommonMark</dt> | ||
<dd>**Syntax**: A trailing backslash (`\`) \*\*</dd> | ||
<dd>**Inline HTML**: Supported</dd> | ||
|
||
<dt>Markdown</dt> | ||
<dd>**Syntax**: None</dd> | ||
<dd>**Inline HTML**: Supported</dd> | ||
|
||
<dt>MediaWiki</dt> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The correct term might be Wikitext. See https://en.wikipedia.org/wiki/Help:Wikitext There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I'd argue for at least keeping a reference to "MediaWiki". There are many wiki engines out there, and the syntax differs among them (which was the motivation behind WikiCreole). Calling this just "Wikitext" will be ambiguous for those unfamiliar with these nuances. |
||
<dd>**Syntax**: None</dd> | ||
<dd>**Inline HTML**: Supported</dd> | ||
|
||
<dt>OrgMode</dt> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://orgmode.org/ uses "Org mode," not "OrgMode." (The logo and the main heading on the home page uses "Org Mode" with a capital M, but all other instances seem to be "Org mode" or just "Org.") |
||
<dd>**Syntax**: Two trailing backslashes (`\\`)</dd> | ||
<dd>**Inline HTML**: Not supported</dd> | ||
|
||
<dt>reStructuredText</dt> | ||
<dd>**Syntax**: Leading vertical line (`|`) in a [line block][rst-line-block]</dd> | ||
<dd>**Inline HTML**: Not supported</dd> | ||
|
||
> \* | ||
> The _Line Break_ element is represented as | ||
> an empty tag (`<br>`) in HTML, | ||
> and either a tag pair (`<br></br>`) or | ||
> a self-closing tag (`<br />`) in XHTML. | ||
|
||
> \*\* | ||
> Although CommonMark allows the use of trailing spaces | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
More specifically, the use of two or more trailing spaces, as mentioned in the specs:
Again, not sure if this is necessary info; just saying. 😄 |
||
> to indicate breaks between consecutive lines, | ||
> this syntax is incompatible with | ||
> tools that automatically strip trailing whitespace. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other drawbacks of trailing spaces:
Not sure if it's necessary or relevant to mention these in the spec. |
||
|
||
</dd> | ||
|
||
|
@@ -226,6 +262,7 @@ If you’d like to leave feedback, please | |
[commonmark]: http://commonmark.org | ||
[github-issues]: https://github.com/sembr/specification/issues | ||
[haddock]: https://www.haskell.org/haddock/doc/html/ | ||
[rst-line-block]: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#line-blocks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: should this be moved between (I suspect this used to be |
||
[markdown]: https://daringfireball.net/projects/markdown/ | ||
[mattt]: https://mat.tt | ||
[mediawiki]: https://www.mediawiki.org/wiki/Help:Formatting | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think "None" is sufficiently transparent here. The double trailing spaces is an option prescribed by the original spec, even if we'd prefer not to encourage it. In any case, the ** should be added here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, for transparency and consistency.
Then the text in ** should be updated to talk about Markdown in general, or Markdown and CommonMark, but not just CommonMark.
(I was unsure whether the original spec has this feature, and indeed it does: https://daringfireball.net/projects/markdown/syntax#p)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have added a link. Thanks for doing so.