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

Diff: Add nest token #2281

Merged
merged 1 commit into from
Apr 4, 2020
Merged

Diff: Add nest token #2281

merged 1 commit into from
Apr 4, 2020

Conversation

chenxsan
Copy link
Contributor

@chenxsan chenxsan commented Apr 3, 2020

When using diff lang,

  {
    "name": "webpack-demo",
    "version": "1.0.0",
    "description": "",
    "scripts": {
-      "test": "echo \"Error: no test specified\" && exit 1"
+      "test": "echo \"Error: no test specified\" && exit 1",
+      "build": "webpack"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "devDependencies": {
      "webpack": "^4.20.2",
      "webpack-cli": "^3.1.2"
    },
    "dependencies": {
      "lodash": "^4.17.5"
    }
  }

we sometimes do not want to copy + - along with other texts. We can make it if we can select + - with css class:

.target-diff-prefix { user-select: none;}

But we can't make it without diff highlight plugin which is unfortunately not supported in refractor we use.

This pull request would bring the support without plugin.

@chenxsan chenxsan force-pushed the prefix-diff branch 2 times, most recently from a809e5d to 9f6a2d4 Compare April 4, 2020 13:12
Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Thank you for contributing @chenxsan!

@RunDevelopment RunDevelopment merged commit fd432a5 into PrismJS:master Apr 4, 2020
@chenxsan
Copy link
Contributor Author

chenxsan commented Apr 4, 2020

@RunDevelopment Thanks for your kind help!

@chenxsan chenxsan deleted the prefix-diff branch April 4, 2020 13:52
quentinvernot pushed a commit to TankerHQ/prismjs that referenced this pull request Sep 11, 2020
This adds a token to match line prefixes.
@karlhorky
Copy link
Contributor

Really cool, thanks for this @chenxsan and @RunDevelopment !

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.

3 participants