mdsquare 0.1.0 → 0.3.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.
- package/README.md +115 -19
- package/dist/callout.js +3 -0
- package/dist/codeBlock.js +3 -1
- package/dist/editor.d.ts +19 -1
- package/dist/editor.js +48 -22
- package/dist/extensions.d.ts +11 -3
- package/dist/extensions.js +6 -4
- package/dist/footnote.d.ts +24 -3
- package/dist/footnote.js +458 -163
- package/dist/footnoteSyntax.d.ts +6 -3
- package/dist/footnoteSyntax.js +37 -39
- package/dist/hashtag.js +8 -3
- package/dist/heading.js +6 -0
- package/dist/horizontalRule.js +1 -0
- package/dist/link.d.ts +47 -1
- package/dist/link.js +347 -14
- package/dist/list.js +39 -0
- package/dist/listIndent.js +1 -0
- package/dist/mention.js +16 -4
- package/dist/quote.js +70 -16
- package/dist/tableModel.js +1 -0
- package/dist/task.js +1 -0
- package/dist/tikz.js +1 -1
- package/dist/utils/textWidth.d.ts +6 -0
- package/dist/utils/textWidth.js +11 -0
- package/package.json +1 -1
package/dist/task.js
CHANGED
package/dist/tikz.js
CHANGED
|
@@ -230,7 +230,7 @@ class TikzWidget extends WidgetType {
|
|
|
230
230
|
return false;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
const CONTAINERS = new Set(["Document", "Blockquote", "BulletList", "OrderedList", "ListItem"]);
|
|
233
|
+
const CONTAINERS = new Set(["Document", "Blockquote", "BulletList", "OrderedList", "ListItem", "FootnoteDefinition"]);
|
|
234
234
|
function scanTikz(state, languages) {
|
|
235
235
|
const { doc } = state;
|
|
236
236
|
const found = [];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 넓은 글자(한글, 한자, 가나, 전각, 이모지)는 2칸, 나머지는 1칸 */
|
|
2
|
+
export const WIDE_CHAR = /[\u1100-\u115F\u2E80-\uA4CF\uAC00-\uD7A3\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFF60\uFFE0-\uFFE6\u{1F300}-\u{1FAFF}\u{20000}-\u{3FFFD}]/u;
|
|
3
|
+
/** 글자 하나의 폭 (칸) */
|
|
4
|
+
export const charWidth = (ch) => (WIDE_CHAR.test(ch) ? 2 : 1);
|
|
5
|
+
/** 글의 폭 (칸) */
|
|
6
|
+
export function displayWidth(text) {
|
|
7
|
+
let width = 0;
|
|
8
|
+
for (const ch of text)
|
|
9
|
+
width += charWidth(ch);
|
|
10
|
+
return width;
|
|
11
|
+
}
|