mdrefine 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/CONTRIBUTING.md +21 -1
- package/README.md +1 -1
- package/dist/core/engine.js +12 -3
- package/dist/core/engine.js.map +1 -1
- package/dist/rules/blocks.js +39 -4
- package/dist/rules/blocks.js.map +1 -1
- package/dist/rules/dialects.js +11 -0
- package/dist/rules/dialects.js.map +1 -1
- package/dist/rules/links.js +9 -2
- package/dist/rules/links.js.map +1 -1
- package/dist/rules/style.js +78 -1
- package/dist/rules/style.js.map +1 -1
- package/dist/syntax/misread-lists.d.ts +31 -1
- package/dist/syntax/misread-lists.js +246 -5
- package/dist/syntax/misread-lists.js.map +1 -1
- package/dist/syntax/obsidian.js +10 -2
- package/dist/syntax/obsidian.js.map +1 -1
- package/docs/design.md +7 -4
- package/docs/obsidian.md +32 -0
- package/docs/quick-start.md +1 -1
- package/docs/rules.md +28 -14
- package/package.json +3 -1
package/docs/rules.md
CHANGED
|
@@ -290,7 +290,8 @@ only when the new destination leads to the same file and fragment.
|
|
|
290
290
|
- `extension`: whether the path to a Markdown file ends in `.md`. `omit` applies
|
|
291
291
|
in the Obsidian dialect only.
|
|
292
292
|
- `leadingDot`: with `relative`, start a path with `./` when it does not start
|
|
293
|
-
with
|
|
293
|
+
with `./` or `../`, also a path to a name that starts with a dot, such as
|
|
294
|
+
`./.gitignore`.
|
|
294
295
|
|
|
295
296
|
A relative path also gets `./` when it would otherwise name a different file at
|
|
296
297
|
the vault's root. A destination that already has the configured spelling keeps
|
|
@@ -447,7 +448,9 @@ Options: none.
|
|
|
447
448
|
|
|
448
449
|
Writes the type of an Obsidian callout in lowercase, custom types included. The
|
|
449
450
|
title and the body are left as written, and so is a marker written with an
|
|
450
|
-
escape or a character reference, such as `\[!TIP]
|
|
451
|
+
escape or a character reference, such as `\[!TIP]`, and one that Obsidian shows
|
|
452
|
+
as text because more than one space or a tab separates it from the quote's `>`,
|
|
453
|
+
as in `> [!TIP]`.
|
|
451
454
|
|
|
452
455
|
Before:
|
|
453
456
|
|
|
@@ -611,7 +614,9 @@ lines at the start and at the end of a document. The option `maximum` is an
|
|
|
611
614
|
integer of at least 1; the default is 1. The line break that ends the last line
|
|
612
615
|
stays; [`style/final-newline`](#stylefinal-newline) adds it where it is missing.
|
|
613
616
|
Inside a block quote, a line of only `>` markers is a blank line, and repeated
|
|
614
|
-
ones are removed the same way.
|
|
617
|
+
ones are removed the same way. In the Obsidian dialect, a line of blank space
|
|
618
|
+
that holds a tab, or that lies directly below an HTML block, is not blank:
|
|
619
|
+
Obsidian's Reading view reads it as more of the paragraph or block above it.
|
|
615
620
|
|
|
616
621
|
Before, with three blank lines between the blocks and two at the end:
|
|
617
622
|
|
|
@@ -783,6 +788,12 @@ so are the exceptions of [Forgejo and Gitea](dialects.md#forgejo-and-gitea):
|
|
|
783
788
|
`x~~_b_~~`, which GitHub reads as inside a word.
|
|
784
789
|
- Text whose markers CommonMark pairs otherwise than the parser, as in
|
|
785
790
|
`xab***a* a*y`: GitHub follows CommonMark, so the parser misread the text.
|
|
791
|
+
- In Obsidian, a paragraph, heading, or table cell whose text holds a `*` or `_`
|
|
792
|
+
that is not a marker, as in `snake_case` or `5 * 3`. Obsidian's Reading view
|
|
793
|
+
pairs such a character with a later one, so `snake_case and _em_` shows
|
|
794
|
+
`case and _em` as emphasis, and `snake_case and *em*` is right only with the
|
|
795
|
+
`*` kept. Escaped characters and those in code, math, or wikilinks do not
|
|
796
|
+
count.
|
|
786
797
|
|
|
787
798
|
## `style/final-newline`
|
|
788
799
|
|
|
@@ -1179,14 +1190,16 @@ Line one\
|
|
|
1179
1190
|
line two
|
|
1180
1191
|
```
|
|
1181
1192
|
|
|
1182
|
-
Blank space is left as written where it is content:
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1193
|
+
Blank space is left as written where it is content: on a line of blank space
|
|
1194
|
+
that holds a tab or lies directly below an HTML block in the Obsidian dialect,
|
|
1195
|
+
which Obsidian's Reading view reads as more of the block above it; in code
|
|
1196
|
+
blocks, except on their fence lines, and in HTML, math, front matter, Obsidian
|
|
1197
|
+
comments, code spans, and link titles and labels that span lines. With
|
|
1198
|
+
`"backslash"`, a break stays as spaces where a backslash would change what the
|
|
1199
|
+
line says: after another backslash, after a literal autolink such as
|
|
1200
|
+
`www.example.com`, which would take the backslash into its address, on the title
|
|
1201
|
+
line of an alert or callout, in a paragraph that starts like a link reference
|
|
1202
|
+
definition (`[label]:`), and on Forgejo and Gitea inside `\(...\)` math.
|
|
1190
1203
|
|
|
1191
1204
|
## `style/wrap`
|
|
1192
1205
|
|
|
@@ -1204,9 +1217,10 @@ onto one, without the spaces and tabs that start its next line, as renderers
|
|
|
1204
1217
|
read it. On a lazy continuation line, which keeps them, such a code span stays
|
|
1205
1218
|
as written, and so does its paragraph. In Obsidian, the text of a link stays
|
|
1206
1219
|
whole and is joined onto one line too, because Live Preview shows a link whose
|
|
1207
|
-
text spans lines as its Markdown source.
|
|
1208
|
-
|
|
1209
|
-
|
|
1220
|
+
text spans lines as its Markdown source. For the same reason, an inline footnote
|
|
1221
|
+
(`^[…]`) on one line stays whole there, and a paragraph with one that spans
|
|
1222
|
+
lines keeps its lines. List markers, block quote markers, and indentation count
|
|
1223
|
+
toward the width, a tab up to the next multiple of four columns.
|
|
1210
1224
|
|
|
1211
1225
|
A word that would start a block at the start of a line, such as a list marker,
|
|
1212
1226
|
`#`, `>`, a run of `-` or `=`, or a table delimiter row such as `|---|`, stays
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdrefine",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Configurable Markdown linting and formatting for CommonMark, GitHub, Forgejo, Gitea, and Obsidian",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -91,6 +91,8 @@
|
|
|
91
91
|
"docs:preview": "vitepress preview docs",
|
|
92
92
|
"benchmark": "node benchmarks/run.mjs",
|
|
93
93
|
"prebenchmark": "npm run build",
|
|
94
|
+
"check:obsidian": "run-s build check:obsidian:run",
|
|
95
|
+
"check:obsidian:run": "node scripts/obsidian-check.mjs",
|
|
94
96
|
"release:prepare": "run-s check release:pack",
|
|
95
97
|
"release:pack": "node scripts/package-smoke.mjs --retain",
|
|
96
98
|
"schema": "run-s build schema:write",
|