41 - plainMarkdownToAdf keeps a callout title's link targets; Goal 6, what happens is what the audience expects
This commit is contained in:
@@ -42,22 +42,23 @@ In priority order.
|
||||
plain markdown cannot hold — format, design, structure — never content: what a reader of the
|
||||
rendered document sees or follows, its text, images and link targets. Content the document only
|
||||
references is marked where it stood, by a note that reads as the converter's and names what was
|
||||
left out. What is dropped goes the way the audience expects. The lossy pair creates and
|
||||
exports; it never saves back over the document it read — identity (task, mention, media ids)
|
||||
lives only in the lossless pair.
|
||||
6. **Failures are values.** Nothing throws, and `code` is a closed list — as much a contract as
|
||||
left out. The lossy pair creates and exports; it never saves back over the document it read —
|
||||
identity (task, mention, media ids) lives only in the lossless pair.
|
||||
6. **What happens is what the audience expects.** Where the goals above leave a choice, a
|
||||
conversion takes the one its audience would predict, reading the input as written.
|
||||
7. **Failures are values.** Nothing throws, and `code` is a closed list — as much a contract as
|
||||
the emitted formats are.
|
||||
7. **Nothing in the way.** No runtime dependencies, no I/O, no configuration, no host API: ESM on
|
||||
8. **Nothing in the way.** No runtime dependencies, no I/O, no configuration, no host API: ESM on
|
||||
any ES2022 engine, in a browser as readily as on a server, installed from public npm. The public
|
||||
surface is the conversions, their types, `isAdfDocument`, and what a consumer needs to check a
|
||||
guarantee this README makes; a helper is exported only when a persona cannot do without it.
|
||||
8. **Correct before fast.** Each format means what its own specification says — markdown as the
|
||||
9. **Correct before fast.** Each format means what its own specification says — markdown as the
|
||||
CommonMark spec reads it, well-formed HTML as the HTML standard parses it — both in what this
|
||||
library reads and in what a conforming parser reads from what it writes. A call takes a whole
|
||||
document and returns a whole result.
|
||||
9. **Fast once correct.** Conversion time grows linearly with the document wherever the goals above
|
||||
allow it; a faster path that risks one of them is not taken.
|
||||
10. **Source a contributor can hold.** Any one function reads in one sitting, and no change makes
|
||||
10. **Fast once correct.** Conversion time grows linearly with the document wherever the goals
|
||||
above allow it; a faster path that risks one of them is not taken.
|
||||
11. **Source a contributor can hold.** Any one function reads in one sitting, and no change makes
|
||||
the longest one longer.
|
||||
|
||||
## Audience
|
||||
@@ -131,7 +132,7 @@ read replaces mentions, attachments and macros with text.
|
||||
| ADF | Written | Read back |
|
||||
| --- | --- | --- |
|
||||
| `panel` | a GitHub alert, `> [!WARNING]`: info `NOTE`, note `IMPORTANT`, tip and success `TIP`, warning `WARNING`, error `CAUTION`, custom `NOTE` | `NOTE` info, `IMPORTANT` note, `TIP` tip, `WARNING` warning, `CAUTION` error, and Obsidian's: hint tip; success, check, done success; attention warning; danger, failure, fail, missing, bug, error error; any other word info — in any case; the rest of the marker's line is the first paragraph |
|
||||
| `expand`, `nestedExpand` | Obsidian's folded callout, `> [!NOTE]- Title` | `-` or `+` after any word, the rest of the marker's line the title; an expand inside an expand is a `nestedExpand` |
|
||||
| `expand`, `nestedExpand` | Obsidian's folded callout, `> [!NOTE]- Title` | `-` or `+` after any word, the rest of the marker's line the title, a link as `text (target)`, an autolink as its text; an expand inside an expand is a `nestedExpand` |
|
||||
| `taskList` | `- [x] Done`, `- [ ] Todo` | a bullet list whose every item is so marked, `[X]` too |
|
||||
| `backgroundColor` | `==text==` | `==text==` on one line, the text touching both delimiters, bounded outside by whitespace, punctuation or a line edge, or touching a Han, Hangul, Hiragana, Katakana, Thai, Lao, Khmer or Myanmar character on either side, in the editor's default highlight `#f8e6a0` |
|
||||
| `table` | a pipe table: the first row its header, a cell's blocks on one line, a span kept under its header by empty cells | — |
|
||||
|
||||
Reference in New Issue
Block a user