longdown 2024.4.13 → 2026.2.1

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/README.md CHANGED
@@ -76,6 +76,44 @@ On macOS:
76
76
  pbpaste | longdown - | pbcopy
77
77
  ```
78
78
 
79
+ #### Converting HTML
80
+
81
+ Use `--html` to parse HTML which is useful for copying results to Logseq from web LLM UIs to preserve formatting.
82
+
83
+ Add `--strip-highlights` option to strip bold formatting which tends to be overused by LLMs.
84
+
85
+ ```
86
+ xclip -selection clipboard -out -target text/html | longdown --html --strip-highlights - | xclip -selection clipboard -in
87
+ ```
88
+
89
+ For example:
90
+ ```html
91
+ <h2>1. Introduction</h2>
92
+ <p><strong>Key point</strong>: This is important.</p>
93
+ <ul>
94
+ <li><strong>First item</strong>: description</li>
95
+ <li>normal item</li>
96
+ </ul>
97
+ ```
98
+
99
+ Gets converted into:
100
+ ```
101
+ - ## 1. Introduction
102
+ - **Key point**: This is important.
103
+ -
104
+ - **First item**: description
105
+ - normal item
106
+ ```
107
+
108
+ With `--strip-highlights`:
109
+ ```
110
+ - Introduction
111
+ - Key point: This is important.
112
+ -
113
+ - First item: description
114
+ - normal item
115
+ ```
116
+
79
117
  ## License
80
118
 
81
119
  0BSD
package/lib/cli.js CHANGED
@@ -100,8 +100,10 @@ import "./cljs-runtime/shadow.esm.esm_import$mdast_util_from_markdown.js";
100
100
  SHADOW_ENV.setLoaded("shadow.esm.esm_import$mdast_util_from_markdown.js");
101
101
  import "./cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown.js";
102
102
  SHADOW_ENV.setLoaded("shadow.esm.esm_import$mdast_util_to_markdown.js");
103
- import "./cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown$lib$unsafe.js";
104
- SHADOW_ENV.setLoaded("shadow.esm.esm_import$mdast_util_to_markdown$lib$unsafe.js");
103
+ import "./cljs-runtime/shadow.esm.esm_import$rehype_parse.js";
104
+ SHADOW_ENV.setLoaded("shadow.esm.esm_import$rehype_parse.js");
105
+ import "./cljs-runtime/shadow.esm.esm_import$rehype_remark.js";
106
+ SHADOW_ENV.setLoaded("shadow.esm.esm_import$rehype_remark.js");
105
107
  import "./cljs-runtime/shadow.esm.esm_import$remark_parse.js";
106
108
  SHADOW_ENV.setLoaded("shadow.esm.esm_import$remark_parse.js");
107
109
  import "./cljs-runtime/shadow.esm.esm_import$remark_stringify.js";