hongdown 0.4.0-dev.160 → 0.4.0

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.
Files changed (2) hide show
  1. package/README.md +18 -0
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -213,6 +213,7 @@ git_aware = true # Respect .gitignore and skip .git directory (default:
213
213
 
214
214
  # Formatting options
215
215
  line_width = 80 # Maximum line width (min: 8, default: 80); set to false to disable wrapping
216
+ math = true # Preserve TeX math ($…$ and $$…$$) verbatim (default: true)
216
217
 
217
218
  [heading]
218
219
  setext_h1 = true # Use === underline for h1 (default: true)
@@ -446,6 +447,23 @@ const { output, warnings } = await formatWithCodeFormatter(markdown, {
446
447
  - East Asian wide characters are counted as 2 columns
447
448
  - Long words that cannot be broken are preserved
448
449
 
450
+ ### Math
451
+
452
+ - Inline (`$…$`) and display (`$$…$$`) TeX/LaTeX math is preserved verbatim,
453
+ never escaped or punctuation-transformed (like code spans)
454
+ - Inline math is kept on a single line when wrapping
455
+ - Dollar-math parsing follows GitHub's rules, so a lone `$`, `$ command`, or
456
+ `$5` stays literal text
457
+ - Disable with `math = false` in *.hongdown.toml* to treat every `$` as text
458
+
459
+ ~~~~ markdown
460
+ The complexity is $O(n \log n)$.
461
+
462
+ $$
463
+ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
464
+ $$
465
+ ~~~~
466
+
449
467
  ### Links
450
468
 
451
469
  - External URLs are converted to reference-style links
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hongdown",
3
- "version": "0.4.0-dev.160+116f97bd",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "A Markdown formatter that enforces Hong Minhee's Markdown style conventions",
6
6
  "license": "GPL-3.0-or-later",
@@ -27,11 +27,11 @@
27
27
  "node": "\u003e=18"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@hongdown/darwin-arm64": "0.4.0-dev.160+116f97bd",
31
- "@hongdown/darwin-x64": "0.4.0-dev.160+116f97bd",
32
- "@hongdown/linux-arm64": "0.4.0-dev.160+116f97bd",
33
- "@hongdown/linux-x64": "0.4.0-dev.160+116f97bd",
34
- "@hongdown/win32-arm64": "0.4.0-dev.160+116f97bd",
35
- "@hongdown/win32-x64": "0.4.0-dev.160+116f97bd"
30
+ "@hongdown/darwin-arm64": "0.4.0",
31
+ "@hongdown/darwin-x64": "0.4.0",
32
+ "@hongdown/linux-arm64": "0.4.0",
33
+ "@hongdown/linux-x64": "0.4.0",
34
+ "@hongdown/win32-arm64": "0.4.0",
35
+ "@hongdown/win32-x64": "0.4.0"
36
36
  }
37
37
  }