Repository navigation
Improve styling of Step Recorder button - #111
Merged
Merged
Conversation
acywatson
pushed a commit
that referenced
this pull request
Apr 9, 2022
etrepum
pushed a commit
to etrepum/lexical
that referenced
this pull request
Oct 31, 2026
…backslash before raw output, and keep all look-ahead text matches per line ## Description - Emails: a reference that export writes inside an email (`[email protected]&meta#111;**“x”**`) cut `@lexical/mdast`'s link short at the reference, since micromark finds an email only in the text as written. The `@` of such an email now goes out as `@` too, and `@lexical/mdast` links the whole decoded address, as cmark-gfm does. - Backslash before raw output: with `shouldPreserveNewLines`, a raw backslash that ends text right before a code span or other raw output starting with ASCII punctuation or a line ending escaped it, so `a\` then code `x` came back as plain text. It now goes out as `&meta#92;`, as it already did before a marker. - Text matches: import kept the first match per line only for the link syntax, so any other text-match transformer searched what was left of a long line again after each match. It now keeps the match of every transformer whose pattern does not look behind (no `^`, word boundary or lookbehind outside a character class, no `g`, `y` or `v` flag). One helper now shifts a kept match, and copies its named groups. ## Test plan Command: `pnpm exec vitest run --project unit packages/lexical-markdown/src/__tests__/unit/LexicalMarkdown.test.ts` ### Before With this commit's tests and the previous sources: ``` × exports formatting beside an email, which both importers read back 20ms × exports formatting beside the start of an email, which both importers read back 2ms × exports formatting beside an email before a URL, which both importers read back 2ms × exports formatting beside a URL that holds an email, which both importers read back 1ms × keeps an email that holds a reference whole for @lexical/mdast 2ms × spoils a URL for the reference to a backslash before a code span 1ms × searches a line once for a text match that it does not hold 42ms AssertionError: expected 5459 to be less than 520 ``` ### After ``` Test Files 1 passed (1) Tests 778 passed (778) ``` On 30,000 random lines with custom text-match transformers, import gives the same result with the kept matches as with a fresh search after each match. Co-Authored-By: Claude Opus 5.5 <[email protected]>
etrepum
pushed a commit
to etrepum/lexical
that referenced
this pull request
Oct 31, 2026
…er a raw backslash, and walk only delimiter runs at a cut ## Description - When an email holds a reference, export writes each of its `@` as `@` so that micromark readers link the whole address. With `shouldPreserveNewLines`, a raw backslash before the `@` (`x\@b.co`) then escaped the reference's `&`, and the reference came back as literal text. Such an `@` is now left as it is. - After each match, import looks past the delimiter run cut at each edge to read its flanking as it was in the whole line. It walked the run of whatever character sat at the cut, so a look-ahead text-match transformer matching a long run of one character piece by piece walked the rest of the run at every match. It now walks only a run of a code-span or format-tag character, which is the only kind whose far side is read. - A comment in `LINK.replace` says that its text-before-the-opener branch serves custom callers, since import passes the label from its real opener. ## Test plan Command: `pnpm exec vitest run --project unit packages/lexical-markdown/src/__tests__/unit/LexicalMarkdown.test.ts` ### Before The new test with the export source of the previous commit: ``` × writes no reference for an email's `@` after a raw backslash 18ms AssertionError: expected 'x\@b.c&meta#111;**“y”**' to be 'x\@b.c&meta#111;**“y”**' // Object.is equality ``` ### After ``` Test Files 1 passed (1) Tests 782 passed (782) ``` The run-walk change has no observable output; import was compared with the previous commit on 20,000 random lines with custom text-match transformers, with no differences. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the button a bit nicer and moves it to the bottom right of the screen. It switches to a red colour when enabled like the chrome dev tools record button does.