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

Replace "marked" with "markdown-it" #13623

Merged
merged 5 commits into from
Aug 22, 2017
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Aug 21, 2017

Fixes #13425

Replaces marked dependency with markdown-it

backported to 6.0 #13666
backported to 6.1 #13667

@nreese nreese changed the title Replaced "marked" with "markdown-it" Replace "marked" with "markdown-it" Aug 21, 2017
@tylersmalley
Copy link
Contributor

@nreese, can you give some context into the reason for this change?

@nreese
Copy link
Contributor Author

nreese commented Aug 22, 2017

@tylersmalley marked is not longer a maintained project. The referenced issue, #13425, provides more details - but the short answer is that @epixa opened the issue and asked me to swap out marked.

@tylersmalley
Copy link
Contributor

Thanks @nreese, somehow I read over the linked issue.

Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to work as intended. Code looks straightforward. LGTM! Nice tests.

@@ -149,7 +149,7 @@
"less": "2.7.1",
"less-loader": "2.2.3",
"lodash": "3.10.1",
"marked": "0.3.6",
"markdown-it": "8.3.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few differences that I'm seeing between marked/markdown-it, using the following markdown:

Ordered

1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa


1. You can use sequential numbers...
1. ...or keep all the numbers as `1.`

Start numbering with offset:

57. foo
1. bar

Autoconverted link https://github.com/nodeca/pica (enable linkify to see)

I'm seeing the following with marked:
screen shot 2017-08-22 at 3 02 04 pm

And the following with markdown-it:
screen shot 2017-08-22 at 3 01 44 pm

I believe that markdown-it is doing the numbering "correctly" or it at least matches what GitHub does; however, I figured this should at least be noted somewhere.

Regarding the auto-linking, this is something that marked used to automatically include, do we want to support this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its an easy configuration change to enable. I am +1 on enabling. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm +1 on enabling auto linking, for what it's worth. If someone is putting a raw link into a markdown document, it's hard to imagine the circumstance where they want people to copy and paste that URL rather than just click it.

If we're happier with the markdown-it number approach, then we should pull the bandaid off. This is is a major version change anyway, so breaking changes can happen.

@epixa
Copy link
Contributor

epixa commented Aug 22, 2017

Speaking of breaking changes, @nreese can you add the switch in markdown processors to the breaking change docs in this PR?

Copy link
Contributor

@kobelb kobelb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nreese nreese merged commit 0d281a7 into elastic:master Aug 22, 2017
nreese added a commit to nreese/kibana that referenced this pull request Aug 23, 2017
* add markdown functional test

* update markdown vis to use markdown-it

* migrate markdown angular filter to markdown-it

* place other uses of marked and remove dependency

* update breaking changes documenation and set linkify to true
nreese added a commit to nreese/kibana that referenced this pull request Aug 23, 2017
* add markdown functional test

* update markdown vis to use markdown-it

* migrate markdown angular filter to markdown-it

* place other uses of marked and remove dependency

* update breaking changes documenation and set linkify to true
nreese added a commit that referenced this pull request Aug 23, 2017
* add markdown functional test

* update markdown vis to use markdown-it

* migrate markdown angular filter to markdown-it

* place other uses of marked and remove dependency

* update breaking changes documenation and set linkify to true
nreese added a commit that referenced this pull request Aug 24, 2017
* add markdown functional test

* update markdown vis to use markdown-it

* migrate markdown angular filter to markdown-it

* place other uses of marked and remove dependency

* update breaking changes documenation and set linkify to true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants