Skip to content

Markdown serialization silently drops highlight, superscript, subscript, and text alignment #85

Description

@rajkumargaramie

Some editor formatting tools apply correctly in the editor but are silently lost when the document is serialized to Markdown.

Affected tools:

  • Highlight / text color
  • Superscript
  • Subscript
  • Text alignment

Root cause:

These marks/attributes have no Markdown serialization handlers registered in the PM→MD conversion pipeline (pmToMdConverter.ts). The code explicitly skips them:

console.warn('Unsupported mark type for markdown: ' + mark.type.name + ...);
DocumentMarkdownInlineTokenizer.ts ~L271

The extensions define DOM parsing (<mark>, <sup>, <sub>, <p style="text-align:...">) but never register markdown token handlers, so the marks are silently dropped during serialization.

Expected:
Formatting applied with these tools persists through save/reload (markdown round-trip).

Actual:
Formatting appears in the editor but is lost on the next load because the markdown serializer has no representation for these marks.

Possible approaches:

  • Extended markdown syntax (e.g. ==highlight==, ^superscript^, ~subscript~) with matching parser support
  • HTML passthrough (e.g. <mark>, <sup>, <sub>) preserved in the markdown output

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions