Commit 1c826d4
Fix markdown-to-storage rendering on Confluence Cloud (#75)
* Fix markdown-to-storage rendering issues on Confluence Cloud
- Use smart links (data-card-appearance="inline") for Cloud instances
instead of ac:link/ri:url which Cloud no longer renders. Server/DC
instances continue using the ac:link format.
- Decode HTML entities (" & < >) inside code blocks
before wrapping in CDATA, so code renders with literal characters
instead of escaped entities.
- Trim trailing newline that markdown-it appends to code block content,
which caused an extra blank line in rendered Confluence code macros.
- Remove global HTML entity decode (< > &) that was stripping
angle-bracket placeholders (e.g. <tenant>) from inline text. Code
blocks now handle their own entity decoding before CDATA insertion.
* Add CDATA injection defense and fix entity decode order
- Escape ]]> in code block content to prevent premature CDATA
termination when user code contains XML/CDATA snippets
- Move & decode last to avoid double-decoding entities
- Add test for CDATA terminator escaping in code blocks
Addresses review feedback from pchuri on PR #75.
* Remove duplicate isCloud() method introduced by rebase
The rebase onto main (v1.27.3) introduced a duplicate isCloud() at line
95. The upstream version at line 86 is preferred as it also handles
scoped tokens via isScopedToken(). Removes the duplicate to fix the
ESLint no-dupe-class-members error.
---------
Co-authored-by: Eric Schoeller <schoelle@colorado.edu>1 parent 9bd6896 commit 1c826d4
2 files changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | | - | |
1077 | 1076 | | |
1078 | | - | |
1079 | | - | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1080 | 1081 | | |
1081 | 1082 | | |
1082 | 1083 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
330 | 340 | | |
331 | 341 | | |
332 | 342 | | |
| |||
0 commit comments