mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-12-02 08:59:32 +01:00
fix: set dir="auto" after the linkifier so code-only documents stay linear (release review)
`_renderMarkdown` wrote dir="auto" into its string, before the code pins and the linkifier. An element carrying dir="auto" re-resolves its direction on every insertion under it, and a block whose letters all sit in `dir` children walks its whole subtree each time, so a code-only or path-only document went quadratic, English ones included. Measured in real Chromium through the real File Viewer, before and after: 9000 inline-code items 8.7 s to 0.35 s, 9000 bare paths 5.6 s to 0.23 s, a 209 KB out-of-workspace list 41.9 s to 1.4 s. All three now match master. The pass is now `_applyBlockDirection()`, run last on the DOM by both consumers. The direction results are unchanged. Tests pin that the rendered string holds no dir="auto" and that the pass runs after the linkifier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f37f101137
commit
4413240c5f
4 files changed
+89
-27
No files matched your search
@@ -5071,6 +5071,7 @@ Object.assign(CodemanApp.prototype, {
|
||||
const doc = tmpl.content.firstElementChild;
|
||||
this._rebaseFilePreviewMarkdownRefs(doc, info);
|
||||
this._linkifyFilePaths(doc);
|
||||
this._applyBlockDirection(doc);
|
||||
// The linkifier's absolute paths name no session; give them the
|
||||
// preview's, like the rebased links, or they open in the active tab's.
|
||||
for (const a of doc.querySelectorAll('a.rv-path:not([data-session-id])')) a.dataset.sessionId = info.sessionId;
|
||||
|
||||
Reference in new issue
Block a user