Commit 0d07bf5
In note text tagging improvement (#283)
* adding txt2tags-it: support to txt2tags syntax in addition to the markdown one
* fix: strikethrough, HTML options default, link rules ordering
- Enable html:true by default so HTML comments (<!-- -->) are passed
through as-is instead of being escaped as visible text
- Fix --strikethrough-- to use <s> tag instead of <del>, consistent
with markdown ~~strikethrough~~ rendering
- Remove + item ordered list editor highlighting rule (was applying
an unwanted heading style to list lines)
- Fix basePath undefined variable → path in relative URL resolution
- Register txt2tags_link before adding autolink/wikilink rules:
ruler.before("txt2tags_link", ...) threw "Parser rule not found"
when called before txt2tags_link was itself registered, aborting
the entire plugin initialisation and breaking all txt2tags rendering
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* updating and fixing
* fix version and credits
* fix: Qt6 compatibility — resolve markdown-it constructors via module namespace
In Qt5, importing a JS file in QML binds the module's top-level `this` to
the QML global scope, so UMD modules export their constructors onto the
component via `g = this; g.markdownit = f()`, and `this.markdownit` works
in init().
In Qt6, the module's top-level `this` is the module namespace object
(e.g. MarkdownIt, MarkdownItTxt2tags), not the QML component scope.
So the constructors land on `MarkdownIt.markdownit` etc., and
`this.markdownit` in init() is undefined — causing silent init failure
and a blank preview.
Fix: resolve each constructor with `Namespace.name || this.name` so that
Qt6 uses the module namespace and Qt5 falls back to the component scope.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: Qt6 UMD compat — use globalThis when module this is undefined
In Qt6 QML, JavaScript files imported via 'import "foo.js" as Foo'
run in strict mode where `this` at the top level is undefined.
The UMD wrappers in markdown-it, markdown-it-deflist, markdown-it-katex
and markdown-it-txt2tags all fell back to `g = this` when window/global/self
were undefined, then threw TypeError setting a property on undefined.
Fix: insert `globalThis` before the `this` fallback in each UMD chain.
globalThis is always the real global object in Qt6's JS engine.
In init(), resolve constructors via `_g = globalThis || this` so that
Qt6 uses globalThis (where the modules now export) and Qt5 falls back
to the component scope (where the modules previously exported via this).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: Qt6 compat — top-level var export; remove deflist and katex
The root cause of Qt6 breakage: UMD modules used `g = this; g.markdownit = f()`
where `this` at module top-level is undefined in Qt6 strict mode, so the
assignment threw and nothing was exported.
Fix: declare `var markdownit` and `var markdownitTxt2tags` at the top level
of each JS file (outside the IIFE). Top-level vars are always accessible via
the QML module qualifier (MarkdownIt.markdownit, MarkdownItTxt2tags.markdownitTxt2tags)
in both Qt5 and Qt6 — no runtime this/globalThis lookup needed.
Also removed the unused deflist and katex plugins to simplify the script.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: remove unused deflist and katex plugins
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix non white space before a tag. Allow to use either # or @ for tags (# is default)
* Guard URL schemes
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* remove other commits outside the scope of this branch
* Revert "remove other commits outside the scope of this branch"
This reverts commit a72474a.
* remove txt2tags-it
* adding myself
Changed > 0 to !== -1 on line 169 so a tag at position 0 (start of note) is correctly detected as
already existing, preventing duplicates.
* fixed a few reviews by copilot on #283
---------
Co-authored-by: luginf <alan@luginf>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Patrizio Bekerle <patrizio@bekerle.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent f0a4580 commit 0d07bf5
2 files changed
Lines changed: 139 additions & 26 deletions
in-note-text-tagging/in-note-text-tagging.qml
100644100755Lines changed: 137 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
13 | 27 | | |
14 | 28 | | |
15 | | - | |
16 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
17 | 45 | | |
18 | 46 | | |
19 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
20 | 55 | | |
21 | 56 | | |
22 | 57 | | |
23 | | - | |
| 58 | + | |
24 | 59 | | |
25 | 60 | | |
26 | 61 | | |
27 | 62 | | |
| 63 | + | |
28 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
29 | 95 | | |
30 | 96 | | |
31 | | - | |
| 97 | + | |
32 | 98 | | |
33 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
34 | 103 | | |
35 | 104 | | |
36 | 105 | | |
37 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
38 | 116 | | |
39 | 117 | | |
40 | 118 | | |
41 | 119 | | |
42 | | - | |
| 120 | + | |
43 | 121 | | |
44 | 122 | | |
45 | | - | |
46 | | - | |
| 123 | + | |
| 124 | + | |
47 | 125 | | |
48 | 126 | | |
49 | 127 | | |
| |||
54 | 132 | | |
55 | 133 | | |
56 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
57 | 147 | | |
58 | 148 | | |
59 | 149 | | |
| |||
67 | 157 | | |
68 | 158 | | |
69 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
70 | 163 | | |
71 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
72 | 167 | | |
73 | 168 | | |
74 | 169 | | |
75 | 170 | | |
76 | 171 | | |
77 | 172 | | |
78 | 173 | | |
79 | | - | |
| 174 | + | |
80 | 175 | | |
81 | 176 | | |
82 | 177 | | |
83 | | - | |
| 178 | + | |
84 | 179 | | |
85 | 180 | | |
86 | 181 | | |
| |||
103 | 198 | | |
104 | 199 | | |
105 | 200 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | 201 | | |
116 | 202 | | |
117 | 203 | | |
| |||
130 | 216 | | |
131 | 217 | | |
132 | 218 | | |
133 | | - | |
| 219 | + | |
134 | 220 | | |
135 | 221 | | |
136 | 222 | | |
137 | 223 | | |
138 | 224 | | |
139 | | - | |
| 225 | + | |
140 | 226 | | |
141 | 227 | | |
142 | 228 | | |
143 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
144 | 257 | | |
145 | 258 | | |
146 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
0 commit comments