Skip to content
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

[Markdown] A collection of issues #266

Closed
10 of 12 tasks
aziz opened this issue Mar 30, 2016 · 15 comments · Fixed by #1355
Closed
10 of 12 tasks

[Markdown] A collection of issues #266

aziz opened this issue Mar 30, 2016 · 15 comments · Fixed by #1355
Labels
T: bug A bug in an existing language feature

Comments

@aziz
Copy link
Contributor

aziz commented Mar 30, 2016

The word `complicated` must be neither bold nor italic below:

perform_complicated_task
perform__complicated__task

But the first part below is italic and bold respectively:

_perform_complicated_task
__perform__complicated__task
  • Plain URLs
Normal plain link http://example.com
Complex url https://github.com/sublime/issues?page=1&state=closed
  • Links Refs with optional titles wrapped in single quotes
[3]: http://example.com/  'Optional Title Here'
  • Escaped backticks inside inline code blocks (seems invalid @wbond)
`raw \` more`
  • Ordered lists and unordered lists inside a block quotes
> Here is a quote block
> - list items
> - inside block
> - quote
> 
> 1. numbered list 
> 2. numbered list another
>
  • Detecting empty lines inside a block quote with just > symbol
> Here is a quote block
This quote continues on.  Line breaking is OK in markdown
> Here it is again
>
> The `>` in line above should be marked as punctuation but it's not
  • Lists immediately after paragraph
this is a paragraph
- and this
- is a list
  • Blockquote and code blocks inside a list
* this is a list

   > This is a blockquote.

 This is a paragraph still part of the 
 list item

* Lorem ipsum

        This is a code block  
* list continues
* list continues

Extended but common Markdown

  • Fenced Blocks
    ```js
      for (var i = 0; i < 10; i++) {
         console.log(i);
      }
    ```

Here is test file for fenced blocks

~~This text should be parsed as _strikethroughed_.~~

~~There may be __bold__ or _italic_ text inside strikethroughed text.~~

~~There may be ![Mou icon](mo.com) a keyboard `complicated` shortcut like [GFM][GFM] inside strikethroughed text.~~

__There may be ~~strikethroughed text~~ inside bold text.__
_There may be ~~strikethroughed text~~ inside italic text._

~~ If there is a space in the beginning or end, it won't work as per the [GFM][GFM] docs ~~
@wbond
Copy link
Member

wbond commented Mar 30, 2016

Excellent, thanks for the examples!

@FichteFoll
Copy link
Collaborator

Can you point to a specification where backslashes inside backticks are supposed to escape the following backtick? Or is that meant the other way around?

Personally, I've been using the MarkdownEditing package with its GFM definition for the longest time.

@keith-hall
Copy link
Collaborator

@FichteFoll
Copy link
Collaborator

I'm rather sure this is supposed to escape the opening part (like this: ) and not to work within code blocks, since those are literal. It doesn't work that way in any markdown implementation I tested (github GFM, discourse).
For including backticks in code blocks, more backticks are to be used.

@wbond wbond added the T: bug A bug in an existing language feature label Apr 28, 2016
@jonschlinkert
Copy link

Also, fenced code blocks are not highlighted when immediately following text without an extra newline:

screen shot 2016-05-17 at 2 08 48 am

With an extra newline:

screen shot 2016-05-17 at 2 10 14 am

@wbond
Copy link
Member

wbond commented Jun 2, 2016

I believe that technically lists right after paragraphs are not supported, and I'm not sure how we would handle that without incorrect marking up a paragraph containing a - or * at the beginning of a line incorrectly.

If there is info about this feature in terms of compatibility with various markdown engines, that could be useful.

@jonschlinkert
Copy link

I believe that technically lists right after paragraphs are not supported

I wasn't sure either, so I looked up the spec: http://spec.commonmark.org/0.24/#lists

Here is a quote a few paragraphs down:

In CommonMark, a list can interrupt a paragraph. That is, no blank line is needed to separate a paragraph from a following list:

@FichteFoll
Copy link
Collaborator

Markdown implementations are all different to this date, even after commonmark was published. Still, I believe that commonmark is the most specified flavor currently and basing on it sounds like a good idea, especially considering that more platforms are moving to it slowly.

@wbond
Copy link
Member

wbond commented Feb 10, 2017

@keith-hall just fixed a number of these in #803. I've checked off what I believe has been completed.

@keith-hall
Copy link
Collaborator

I believe "Underscore in the middle of words" can also be ticked off :)

@wbond
Copy link
Member

wbond commented Mar 21, 2017

And some more fixes by @keith-hall in #806!

The only thing I noticed was that:

* this is a list

   > This is a blockquote.

 This is a paragraph still part of the 
 list item

* Lorem ipsum

        This is a code block  
* list continues
* list continues

The last list item continues the paragraph scope from the second-to-last list item.

@keith-hall
Copy link
Collaborator

Plain URLs and tables have now been added to the Markdown syntax :)

@rwols
Copy link
Contributor

rwols commented Aug 7, 2017

Will syntax highlighting in code blocks ever happen? It seems very easy to add this feature at this point.

@FichteFoll
Copy link
Collaborator

There are two main issues with highlighting in code blocks.

  1. It increases the size of the compiled syntax (and compilation time) by including many other syntaxes
  2. It could only be done for syntaxes in default packages (which are still quite a few and most likely all that you'd ever need).

I'd be fine with 2 but I don't feel like being in a position to decide 1.

For reference, the latex syntax includes a lot of syntaxes and is by far the biggest compiled one, as far as I remember.

@wbond
Copy link
Member

wbond commented Aug 7, 2017

As @FichteFoll mentioned in point 1., the real issue is that the current implementation of including syntaxes in other syntaxes involves embedding them. LaTeX got to the point of the cached regex patterns taking up 9MB on disk (I believe there were around 8k contexts in the syntax), and users would see a lag the first time they opened a LaTeX file as the regex cache was loaded into memory to be used for highlighting.

We did some work on reducing the size of the C and C++ syntaxes, which cascaded to LaTeX, but I really need to see if I can get the syntax engine to no require embedding all contexts for things like a language including another. This applies to a lot of markup languages (HTML, Markdown, LaTeX) but also programming languages embedding other languages (such as SQL, HTML, JS, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug A bug in an existing language feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants