Repository navigation
fix(mirror): keep decorating blocks after a math block - #13742
Closed
yuxi-liu-wired wants to merge 1 commit into
Closed
yuxi-liu-wired wants to merge 1 commit into
yuxi-liu-wired wants to merge 1 commit into
Conversation
The line matcher compared a math block's first title line with its rendered first line, which is the $$ fence, so it never matched and every later block lost its status marker and tags. A math block is matched by its fence, like a code block, and the lines inside the fence are skipped.
Contributor
Author
|
Closing: this patches one symptom of a design problem, logseq/db-test#1442 (a block's body is a Markdown string sharing one grammar with every text format). The bug is listed there; the fix is the design, not this patch. |
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 17, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 18, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 18, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 19, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 19, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 20, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 21, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 21, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 22, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 22, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 23, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 24, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 24, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 25, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 25, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 26, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 27, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 28, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 29, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 29, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 30, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 30, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 31, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 31, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 1, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 2, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 3, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 3, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 4, 2026
The embed macro replaced the block's rendered line, heading marker included. The line matcher also takes an empty block's heading marker (###) for the empty block (the same change as in logseq#13742).
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.
After a math block, the Markdown mirror writes every later block of the page without its task status and tags.
Example: a page with a math block followed by a task
aftertagged#Nextmirrors asinstead of
- TODO after #Next.Cause
frontend.worker.markdown-mirror/decorate-rendered-contentwalks the rendered lines and matches each block line to the next block (rendered-line-matches-block?) to add its status marker and tags. A code block is matched by its fence (```) and the lines inside the fence are skipped. A math block is matched by its first title line (E = mc^2), but its rendered first line is- $$, so it never matches; every later block is compared with the math block's info and none of them is decorated. A line inside a math block starting with-would also be taken for a block.Fix
A block's line info carries its fence:
```for a code block,$$for a math block (by display type or tag). A fenced block is matched by its fence, and the lines up to the closing fence are skipped, the same for both.Test
page-mirror-decorates-blocks-after-a-math-block-testinfrontend.worker.markdown-mirror-test: a math block whose formula has a- xline, then a task with a tag. Fails on master (the task losesTODOand#Next), passes with the fix. The other mirror tests pass.Found by fuzzing the Markdown mirror through the Markdown importer.