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

feat: code line number (close: #365) #379

Merged
merged 26 commits into from
May 13, 2018
Merged

feat: code line number (close: #365) #379

merged 26 commits into from
May 13, 2018

Conversation

ulivz
Copy link
Member

@ulivz ulivz commented May 9, 2018

cc @egoist , it also fixed a empty line highlight issue:

`<span class="highlighted-line">${split || '\n'}</span>`

Snapshot

Highlight line + Line number

image

Only line number

image

Only Highlight line

image

@ulivz ulivz requested a review from egoist May 9, 2018 14:40
@ycmjason
Copy link
Contributor

ycmjason commented May 9, 2018

I think it would be nicer to make this a separate markdown-it plugin. Semantically it is not right to put this feature in highlightLines plugin.

P.S. I am working on the same thing too but haven't yet complete it.

@ycmjason
Copy link
Contributor

ycmjason commented May 9, 2018

Also, the current implementation make the line number selectable? Which might not be ideal?

@ulivz
Copy link
Member Author

ulivz commented May 9, 2018

  1. make this a separate markdown-it plugin

Sure, I originally want to make it as a separate plugin, but since markdown-it-highlight-lines rewrite the fence method, so it won't work. but you can try.

  1. it is not right to put this feature in highlightLines plugin.

Agree, but the better choice is to rename this plugin to linePlugin

  1. the current implementation make the line number selectable

Have handled for that.

@xkcoding
Copy link

@ulivz Unbelievable. That's what I want.

@ulivz ulivz mentioned this pull request May 11, 2018
@ulivz
Copy link
Member Author

ulivz commented May 13, 2018

Updated May 13th

Desktop

line-numbers

Mobile

line-numbers-mobile

@ulivz ulivz added the 0.9.0 label May 13, 2018
@ulivz ulivz changed the title code line number (close: #365) feat: code line number (close: #365) May 13, 2018
@ulivz ulivz merged commit 9b42690 into vuejs:master May 13, 2018
@ulivz ulivz mentioned this pull request May 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants