Release 1.0.0
New fatures
Added a code folding extension supporting read-only editors. You can see it in action in the last example on the demo page.
import "prism-code-editor/code-folding.css"
import { readOnlyCodeFolding } from "prism-code-editor/code-folding"
Added a read-only property extensions
to the PrismEditor
interface. This property can be used to access many of the extensions added to the editor.
Ctrl+] / [ can now also be used to indent/outdent lines (Cmd+] / [ on Mac).
Added tag matching, selection match highlighting and read-only code folding to the read-only setup.
Breaking changes
The numLines
signature has been changed from: numLines: (str: string, position?: number) => number
to numLines: (str: string, start?: number, end?: number) => number
. This means that you'll need to change all calls to numLines
with 2 arguments.
The defaultCommands
extension's first argument has been removed since it's no longer necessary to pass the cursor extension to it.
The deprecated matchBrackets
extension has been removed and replaced by the new bracket matcher. If you're already using the new bracket matcher, you'll need to rename it from bracketMatcher
to matchBrackets
. If you're using the old one, you might need to change the arguments and add the highlightBracketPairs
extension.
--widget__bg-find
custom property used to color search matches has been renamed to --search__bg-find
.
Bug fixes
prism-code-editor/prism-markdown
andprism-code-editor/prism-core
are now properly marked as having side-effects in package.json.- Cursor position extension could incorrectly position the cursor with word wrap enabled.
- Empty search matches could be incorrectly positioned with word wrap enabled.
editor.value
could be stale when accessed in an extension update callback. This wasn't causing issues, but had the potensial to.- Extensions no longer update if
setOptions
throws an error due to passing an invalid language