Skip to content

Releases: FIameCaster/prism-code-editor

Release 2.4.0

18 Jan 15:30
Compare
Choose a tag to compare

New features

Better comment toggling for JSX

When inside a JSX context, normal JavaScript comments can't be used. Therefore {/* */} comments will now be used in JSX contexts.(2e38fd2)

A new property on languages getComments was used to make this possible. You can read about it in the API docs.

New commands

  • Shift+Ctrl+K (Shift+Cmd+K on MacOS): Delete line (617da31)
  • Ctrl+Enter (Cmd+Enter on MacOS) Insert blank line (7ee34a4)

Fixes

  • Tag matching and block comment folding now works properly in nested languages (9bab6a3)
  • The JS templates and markup templating Prism languages can no longer break tag matching, bracket matching and code folding

Release 2.3.2

05 Jan 23:20
Compare
Choose a tag to compare

Fixed highlighting when there are tags inside object spread in JSX tags (9ec5299)
Fixed backtracking issues with the new tag patterns for JSX and markup
Improved an edge case when toggling comments in languages without line comments such as CSS or markup (edcc167)
Fixed a bug in the Prism core where the rest property of grammars wasn't ignored by the matchGrammar function

Release 2.3.1

27 Dec 23:36
Compare
Choose a tag to compare
  • Fixed an issue with the TSX tag pattern's lookbehind in Safari (ad82bd0)
  • Carriage returns in the value option are now supported (32dd207)
  • Improved behavior in multiple edge cases when toggling comments or indenting with Tab (03dfdda)

Release 2.3.0

21 Dec 22:13
Compare
Choose a tag to compare

New features

  • Added a parameter to SearchAPI.search which allows you to change the behavior of whole word search (a585839)
  • The highlightSelectionMatches and highlightCurrentWord extensions now expose their search API which can be used to e.g. get the positions of the current matches (38e9f0b)
  • Added source maps to the package for easier debugging (35c96d3)

Improvements and fixes

  • The matchTags extension now correctly handles name spaced tags and matches tags inside attribute values (3e55338)
  • Improved the tag pattern i both JSX and markup. The attribute value has been made optional, and whitespace is now allowed around =, so <div id=> and <div id = "a"> are now highlighted as tags which improves typing experience. Lastly, JSX tag names and attribute names now allow non-ASCII characters (5553f09)
  • Small improvements to the JavaScript grammar (5553f09)
  • Improved word boundries for searching in the highlightCurrentWord extension (ea955f7)
  • Fixed a couple bugs in the highlightTagPunctuation extension (6dbdb27)
  • Creating an editor or calling setOptions with the value option explicitly set to undefined no longer throws an error (5faa832)
  • Constants are now colored differently in the VS Code Light/Dark themes (2f4f534)

Release 2.2.4

10 Dec 15:28
Compare
Choose a tag to compare
  • Improved whole word search behavior
  • A Chrome bug patch for the search widget didn't always work. It now does

Release 2.2.3

03 Dec 16:26
Compare
Choose a tag to compare
  • Fixed PrismJS/prism#3722 for the Kotlin grammar
  • Improved whole word search
  • Opening the search widget programmatically now starts a search with the find input's contents.
  • Fixed opening punctuation of JSX fragments being highlighted by the matchTags extension

Release 2.2.2

17 Nov 13:39
Compare
Choose a tag to compare
  • Fix empty search match before UTF-16 surrogate pair causing infinite loop (5fa8c2c)
  • Search filter is now called with the correct start and end parameters when only a part of the document is searched (5fa8c2c)
  • Slightly altered appearance of empty search matches (5fa8c2c)
  • Improved javascript template strings. Previously strings with empty interpolation expressions such as `a${}b` would not be highlighted as a template string. Now it will be, improving UX while typing (3887da8)

Release 2.2.1

11 Nov 18:56
Compare
Choose a tag to compare
  • Replaced contentEditable hack with -webkit-text-size-adjust: none (6bad6af)
  • Improved some themes while viewing CSS code (8f029b7)
  • Slightly decreased bundle size of the core

Release 2.2.0

04 Nov 17:51
Compare
Choose a tag to compare

Improvements

Including hyphens in the search wasn't wanted for most languages. Therefore a new parameter was added to the highlightCurrentWord extension.

const selector = ".string, .comment, .keyword, .regex"
const filter = start => !getClosestToken(editor, selector, 0, 0, start)
const includeHyphens = position => getLanguage(editor, position) == "css"

editor.addExtensions(
    highlightCurrentWord(filter, includeHyphens)
)

Fixes

In TSX, opening tags comming directly after another tag are now highlighted. This was an issue with Prism's TSX grammar.

Release 2.1.0

01 Nov 16:10
Compare
Choose a tag to compare

New features

  • Added a word highlighting extension.
import { highlightCurrentWord } from "prism-code-editor/search"

const selector = ".string, .comment, .keyword, .regex"
const filter = start => !getClosestToken(editor, selector, 0, 0, start)

editor.addExtensions(
    highlightCurrentWord(filter)
)
  • Added a filter parameter to SearchAPI.search (6786676)

Fixes/improvements

  • Improved API documentation
  • Fixed a bug when toggling comments in languages without line comments (ec7d394)
  • The search widget could sometimes perform a search while closed if the user did an undo in Chrome (2cf42b8)
  • URLs in CSS are now highlighted in the GitHub themes (82120de)