mkDocsAdmonition: escape the admonition title with html.EscapeString
before inserting it into the Confluence storage format XML. An unescaped
title containing '<', '>', '&', or '"' would break the XML structure.
image: add a len(attachments)==0 guard before accessing attachments[0]
in the local-attachment code path. ResolveLocalAttachments always returns
either an error or the requested attachments, so this is currently
unreachable, but the explicit check prevents a future silent panic if the
function's behaviour changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ParseTitle returned lang[start:] without trimming, so inputs like
'python title My Title' returned ' My Title' with leading spaces.
The extra whitespace propagated into the rendered Confluence title
element. Add strings.TrimSpace to remove leading/trailing whitespace.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
GenerateMkDocsAdmonitionLevel walked the AST looking for
ast.KindBlockquote nodes to build a nesting-level map, but the
renderer is registered for parser.KindAdmonition nodes. Because
admonition nodes were never added to the map, LevelMap.Level()
always returned 0 for every admonition, making the level check
in renderMkDocsAdmonition a no-op.
The intended behaviour (all admonitions rendered as Confluence
structured macros regardless of nesting) was accidentally working
because of this bug. Remove the dead MkDocsAdmonitionLevelMap type,
GenerateMkDocsAdmonitionLevel function, and LevelMap field, and
simplify renderMkDocsAdmonition to directly render the Confluence
macro for all known admonition types.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A paragraph node with no children causes FirstChild() to return nil,
making both the entering and leaving Kind() checks panic. Cache the
result once and treat nil the same as a non-RawHTML child (emit <p>).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Convert GFM task list items (- [x] / - [ ]) to Confluence
ac:task-list XML format instead of HTML checkboxes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chore: add test files
fix: add tests for stripnewline and droph1
chore: rename Admontion to MkDocsAdmonition, remove annoying comments
fix: import parser instead of copying the file
chore: rename mkDocs renderer function
fix: fix bug and pipeline
feat: add Support for converting Material for MkDocs Admonitions to Confluence Info Panels
fix: add tests for stripnewline and droph1
chore: rename Admontion to MkDocsAdmonition, remove annoying comments
fix: import parser instead of copying the file
chore: rename mkDocs renderer function
fix: fix bug and pipeline
chore: remove test for droph1 and stripNewLines
fix: add admonitions to StripNewLines and dropH1 tests
feat: add Support for converting Material for MkDocs Admonitions to Confluence Info Panels
fix: add tests for stripnewline and droph1
chore: rename Admontion to MkDocsAdmonition, remove annoying comments
fix: import parser instead of copying the file
chore: rename mkDocs renderer function
fix: fix bug and pipeline
feat: add Support for converting Material for MkDocs Admonitions to Confluence Info Panels
chore: rename Admontion to MkDocsAdmonition, remove annoying comments
fix: import parser instead of copying the file
chore: rename mkDocs renderer function
fix: fix bug and pipeline
chore: remove test for droph1 and stripNewLines
fix: add admonitions to StripNewLines and dropH1 tests
feat: add mkdocsadmonition as opt-in renderer and parser
fix: fix unit tests