~bigbes/confluence-md-utilities

ref: 442bf5982d1e46a2737804b2f30a9b4895e9ac02 confluence-md-utilities/CLAUDE.md -rw-r--r-- 5.8 KiB
442bf598 — Eugene Blikh 2 months ago
fix: round-trip fidelity for tables, page links, and nested lists

Four real-document failures surfaced via `mdcx verify`:

- Pipes inside `<code>` in GFM table cells were treated as column
  separators, splitting cells. `writeTableRow` now escapes `|` as `\|`
  per the GFM spec; the parser strips the backslash before inline
  parsing so the pipe survives inside the resulting code span.
- Two `<code>` elements separated by whitespace text were being merged
  because `isPrev/NextSiblingCode` skipped whitespace nodes. Adjacency
  is now strict.
- `<ac:link><ri:page …/></ac:link>` was dropped because goldmark cannot
  parse `<ac:link>` as raw inline HTML (the colon disqualifies it).
  Preserved via a `<span data-page-link …>` placeholder; the inverse is
  driven by a new `pageLinkDepth` counter in the renderer.
- Nested `<ol>` collapsed to a flat list and went loose because the
  fixed `2*(depth-1)` indent didn't satisfy CommonMark's column rule
  for ordered markers and a stray `\n` after each `<li>` made the list
  loose. Indent is now a per-level stack (3 for ol, 2 for ul/task) and
  list-item terminators use `ensureSingleNewline`.

Regression tests in converter/md2xml_test.go pin each fix; CLAUDE.md
documents the gotchas.
b3d83904 — Eugene Blikh 2 months ago
feat: add pull --with-comments sidecar

`mdcx pull --with-comments` fetches inline + page comments via
`/rest/api/content/{id}/child/comment` (paginated, two-level reply
expansion) and writes them to `<output>.comments.json` alongside the
Markdown file. Inline comments correlate to the markdown's
`data-inline-comment="UUID"` spans through their `marker_ref` field.

Comment bodies are stored as raw Confluence storage XML; pushing
comments back is not implemented. Requires `--output`.
46926399 — Eugene Blikh 4 months ago
Move CLI to cmd/mdcx/, add justfile and CLAUDE.md

Restructure to standard Go project layout: merge package cmd
into package main under cmd/mdcx/. Fix .gitignore to use /mdcx
so it only ignores the binary at repo root. Update install path
in README.md.

false