weml-monaco 0.3.3 → 0.4.2
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 +58 -0
- package/README.md +22 -5
- package/dist/index.cjs +32035 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +108 -0
- package/dist/index.d.ts +101 -10
- package/dist/index.global.d.ts +12 -0
- package/dist/index.global.js +575 -0
- package/dist/{weml-monaco.esm.js → index.mjs} +973 -685
- package/dist/index.mjs.map +1 -0
- package/package.json +51 -16
- package/dist/formatter.d.ts +0 -13
- package/dist/generated/schema.d.ts +0 -33
- package/dist/language.d.ts +0 -4
- package/dist/providers/completion.d.ts +0 -2
- package/dist/providers/diagnostics.d.ts +0 -3
- package/dist/providers/documentSymbols.d.ts +0 -2
- package/dist/providers/hover.d.ts +0 -2
- package/dist/schema/docs.d.ts +0 -13
- package/dist/schema/entities.d.ts +0 -35
- package/dist/schema/snippets.d.ts +0 -26
- package/dist/schema/structureRules.d.ts +0 -81
- package/dist/toolbar/actions.d.ts +0 -28
- package/dist/toolbar/divRenumber.d.ts +0 -12
- package/dist/toolbar/toolbar.d.ts +0 -27
- package/dist/toolbar/wrap.d.ts +0 -11
- package/dist/weml-monaco.esm.js.map +0 -7
- package/dist/weml-monaco.js +0 -31760
- package/dist/weml-monaco.js.map +0 -7
- package/dist/wemlDocument.d.ts +0 -20
package/package.json
CHANGED
|
@@ -1,41 +1,76 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weml-monaco",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "WEML (White Estate Markup Language) language support for the Monaco editor: syntax highlighting, autocomplete, hover docs, structure diagnostics, outline and canonical formatting.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"weml",
|
|
9
|
+
"monaco",
|
|
10
|
+
"monaco-editor",
|
|
11
|
+
"language",
|
|
12
|
+
"egw"
|
|
13
|
+
],
|
|
6
14
|
"repository": {
|
|
7
15
|
"type": "git",
|
|
8
16
|
"url": "git+https://github.com/Burjuy/weml-language-vscode-extension.git",
|
|
9
17
|
"directory": "monaco-editor"
|
|
10
18
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
19
|
+
"homepage": "https://github.com/Burjuy/weml-language-vscode-extension/tree/main/monaco-editor#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/Burjuy/weml-language-vscode-extension/issues"
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/index.d.mts",
|
|
28
|
+
"default": "./dist/index.mjs"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.cjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"./global": {
|
|
36
|
+
"types": "./dist/index.global.d.ts",
|
|
37
|
+
"default": "./dist/index.global.js"
|
|
38
|
+
},
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"main": "./dist/index.cjs",
|
|
42
|
+
"module": "./dist/index.mjs",
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"unpkg": "./dist/index.global.js",
|
|
45
|
+
"jsdelivr": "./dist/index.global.js",
|
|
14
46
|
"files": [
|
|
15
47
|
"dist",
|
|
16
48
|
"README.md",
|
|
17
49
|
"CHANGELOG.md"
|
|
18
50
|
],
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=18"
|
|
53
|
+
},
|
|
19
54
|
"scripts": {
|
|
20
55
|
"prepublishOnly": "node -e \"if (!process.env.CI) { console.error('\\n weml-monaco is published from CI only (.github/workflows/publish-weml-monaco.yml).\\n Bump the version and push to main instead.\\n'); process.exit(1); }\"",
|
|
21
56
|
"typecheck": "tsc -p ./ --noEmit",
|
|
22
|
-
"build
|
|
23
|
-
"
|
|
24
|
-
"build:types": "tsc -p ./ --emitDeclarationOnly --declaration --outDir dist",
|
|
25
|
-
"build": "npm run build:lib && npm run build:esm && npm run build:types",
|
|
57
|
+
"build": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && tsup",
|
|
58
|
+
"check:package": "publint --strict && attw --pack . --profile node16",
|
|
26
59
|
"pack:local": "npm run build && node -e \"const fs = require('fs'); if (!fs.existsSync('pack')) fs.mkdirSync('pack');\" && npm pack --pack-destination=pack",
|
|
27
|
-
"demo": "
|
|
28
|
-
"pretest": "npm run build
|
|
60
|
+
"demo": "npm run build && node -e \"require('fs').copyFileSync('dist/index.global.js', 'demo/weml-monaco.js')\" && echo Open demo/index.html",
|
|
61
|
+
"pretest": "npm run build",
|
|
29
62
|
"test": "node test/smoke.mjs"
|
|
30
63
|
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"node-html-parser": "^6.1.13",
|
|
33
|
-
"vscode-html-languageservice": "^5.2.0"
|
|
34
|
-
},
|
|
35
64
|
"devDependencies": {
|
|
36
|
-
"
|
|
65
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
66
|
+
"esbuild": "^0.25.12",
|
|
37
67
|
"monaco-editor": "^0.45.0",
|
|
38
|
-
"
|
|
68
|
+
"node-html-parser": "^6.1.13",
|
|
69
|
+
"publint": "^0.3.23",
|
|
70
|
+
"tsup": "^8.5.1",
|
|
71
|
+
"typescript": "^5.4.0",
|
|
72
|
+
"vscode-html-languageservice": "^5.2.0",
|
|
73
|
+
"@types/node": "^26.2.0"
|
|
39
74
|
},
|
|
40
75
|
"peerDependencies": {
|
|
41
76
|
"monaco-editor": ">=0.34.0"
|
package/dist/formatter.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface WemlNormalizationFailure extends Error {
|
|
2
|
-
code: string;
|
|
3
|
-
line?: number;
|
|
4
|
-
column?: number;
|
|
5
|
-
expectedTag?: string | null;
|
|
6
|
-
actualTag?: string | null;
|
|
7
|
-
}
|
|
8
|
-
/** Normalises a WEML document string into its canonical, reproducible form. */
|
|
9
|
-
export declare function formatWemlText(input: string): string;
|
|
10
|
-
export declare function isWemlNormalizationFailure(error: unknown): error is WemlNormalizationFailure;
|
|
11
|
-
export declare function isWemlStructureValidationFailure(error: unknown): error is WemlNormalizationFailure;
|
|
12
|
-
/** User-facing reason shown when canonical formatting is deliberately skipped. */
|
|
13
|
-
export declare function canonicalFormattingFailureMessage(error: unknown): string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface EnumValue {
|
|
2
|
-
value: string;
|
|
3
|
-
name: string;
|
|
4
|
-
description: string;
|
|
5
|
-
}
|
|
6
|
-
export interface EnumSchema {
|
|
7
|
-
id: string;
|
|
8
|
-
title: string;
|
|
9
|
-
values: EnumValue[];
|
|
10
|
-
}
|
|
11
|
-
export interface AttributeSchema {
|
|
12
|
-
name: string;
|
|
13
|
-
required: boolean;
|
|
14
|
-
default?: string;
|
|
15
|
-
description: string;
|
|
16
|
-
enumRef?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface TagSchema {
|
|
19
|
-
tag: string;
|
|
20
|
-
description: string;
|
|
21
|
-
attributes: AttributeSchema[];
|
|
22
|
-
notes: string;
|
|
23
|
-
source: string;
|
|
24
|
-
}
|
|
25
|
-
export interface MetaFieldSchema {
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
enumRef?: string;
|
|
29
|
-
}
|
|
30
|
-
export declare const ENUMS: Record<string, EnumSchema>;
|
|
31
|
-
export declare const TAGS: Record<string, TagSchema>;
|
|
32
|
-
export declare const META_FIELDS: MetaFieldSchema[];
|
|
33
|
-
export declare const TEXT_NODE_DESCRIPTION: string;
|
package/dist/language.d.ts
DELETED
package/dist/schema/docs.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AttributeSchema } from '../generated/schema';
|
|
2
|
-
/** Mirrors `monaco.IMarkdownString` without taking a hard dependency on it. */
|
|
3
|
-
export interface Markdown {
|
|
4
|
-
value: string;
|
|
5
|
-
isTrusted?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function tagMarkdown(tag: string): Markdown;
|
|
8
|
-
export declare function attributeMarkdown(tag: string, attr: AttributeSchema): Markdown;
|
|
9
|
-
export declare function enumValueMarkdown(enumRef: string, value: string): Markdown | undefined;
|
|
10
|
-
export declare function enumValuesSummary(enumRef: string): string;
|
|
11
|
-
export declare function metaFieldMarkdown(name: string): Markdown | undefined;
|
|
12
|
-
export declare function entityMarkdown(reference: string): Markdown | undefined;
|
|
13
|
-
export declare function textNodeMarkdown(): Markdown;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export interface EntityInfo {
|
|
2
|
-
/** The character(s) the reference resolves to. */
|
|
3
|
-
char: string;
|
|
4
|
-
/** Human-readable name. */
|
|
5
|
-
name: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const NAMED_ENTITIES: Record<string, EntityInfo>;
|
|
8
|
-
export interface ResolvedEntity {
|
|
9
|
-
/** The full reference text, e.g. "—". */
|
|
10
|
-
reference: string;
|
|
11
|
-
/** The resolved character, or undefined for unknown named references. */
|
|
12
|
-
char?: string;
|
|
13
|
-
/** Human-readable name, when known. */
|
|
14
|
-
name?: string;
|
|
15
|
-
/** Unicode code point, when resolvable. */
|
|
16
|
-
codePoint?: number;
|
|
17
|
-
}
|
|
18
|
-
/** Resolves a character reference (with surrounding `&` and `;`) to its details. */
|
|
19
|
-
export declare function resolveEntity(reference: string): ResolvedEntity | undefined;
|
|
20
|
-
export declare const ENTITY_COMPLETION_PRIORITY: string[];
|
|
21
|
-
/**
|
|
22
|
-
* If the cursor sits inside a partial entity being typed (`&`, `&md`, `R` …),
|
|
23
|
-
* returns the range to replace, including a trailing `;` if already present.
|
|
24
|
-
* Returns undefined when there is no `&`-initiated token before the cursor.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getPartialEntityRange(text: string, offset: number): {
|
|
27
|
-
start: number;
|
|
28
|
-
end: number;
|
|
29
|
-
} | undefined;
|
|
30
|
-
/** Finds the character reference whose span contains `offset` within `text`. */
|
|
31
|
-
export declare function findEntityAt(text: string, offset: number): {
|
|
32
|
-
reference: string;
|
|
33
|
-
start: number;
|
|
34
|
-
end: number;
|
|
35
|
-
} | undefined;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build a `<tag ...>...</tag>` snippet body (including the opening `<`) for
|
|
3
|
-
* the given tag, with required attributes and required descendants filled
|
|
4
|
-
* in as placeholders. The `a` tag is special-cased: use
|
|
5
|
-
* `buildAnchorLinkSnippet`/`buildAnchorIdSnippet` instead.
|
|
6
|
-
*/
|
|
7
|
-
export declare function buildElementSnippet(tag: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Opening tag only, with required attributes as placeholders and no children or
|
|
10
|
-
* line breaks (e.g. `<w-format type="$1">`). Used by tag completion so accepting
|
|
11
|
-
* a suggestion inserts just the start tag; the closing tag is offered separately
|
|
12
|
-
* by the `</` completion.
|
|
13
|
-
*/
|
|
14
|
-
export declare function buildOpeningTag(tag: string): string;
|
|
15
|
-
/** `<a href="...">` variant — a link to another resource, may contain inline content. */
|
|
16
|
-
export declare function buildAnchorLinkSnippet(): string;
|
|
17
|
-
/** `<a id="...">` variant — a named anchor, must be empty. */
|
|
18
|
-
export declare function buildAnchorIdSnippet(): string;
|
|
19
|
-
export interface CompositeSnippet {
|
|
20
|
-
label: string;
|
|
21
|
-
detail: string;
|
|
22
|
-
/** Parent tags whose child slot this snippet is offered for, in addition to the plain tag completion. */
|
|
23
|
-
parents: string[];
|
|
24
|
-
body: string;
|
|
25
|
-
}
|
|
26
|
-
export declare const COMPOSITE_SNIPPETS: CompositeSnippet[];
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
export type NodeCategory = 'container' | 'block' | 'inline';
|
|
2
|
-
export declare const CONTAINER_TAGS: readonly ["w-para", "w-heading", "w-para-group", "w-toc"];
|
|
3
|
-
export declare const BLOCK_TAGS: readonly ["w-text-block", "figure", "w-list", "table", "hr"];
|
|
4
|
-
export declare const INLINE_TAGS: readonly ["a", "br", "w-entity", "w-format", "w-lang", "w-non-egw", "w-note", "w-page", "w-sent"];
|
|
5
|
-
export declare function categoryOf(tag: string): NodeCategory | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* A group of sibling children that share the same allowed tags and count.
|
|
8
|
-
* Every element child of a node must match exactly one group of its
|
|
9
|
-
* StructureRule; a child that matches no group is "not allowed here".
|
|
10
|
-
*/
|
|
11
|
-
export interface ChildGroup {
|
|
12
|
-
tags: string[];
|
|
13
|
-
min: number;
|
|
14
|
-
/** `null` means unbounded. */
|
|
15
|
-
max: number | null;
|
|
16
|
-
description: string;
|
|
17
|
-
}
|
|
18
|
-
export interface StructureRule {
|
|
19
|
-
children: ChildGroup[];
|
|
20
|
-
/** Whether non-whitespace text nodes are allowed as direct children. */
|
|
21
|
-
allowText?: boolean;
|
|
22
|
-
description: string;
|
|
23
|
-
}
|
|
24
|
-
export declare const STRUCTURE_RULES: Record<string, StructureRule>;
|
|
25
|
-
export interface AttributeConstraint {
|
|
26
|
-
tag: string;
|
|
27
|
-
attribute: string;
|
|
28
|
-
kind: 'integer-range' | 'integer-min' | 'pattern';
|
|
29
|
-
min?: number;
|
|
30
|
-
max?: number;
|
|
31
|
-
/** Used when `kind === 'pattern'`. Empty values are always allowed. */
|
|
32
|
-
pattern?: RegExp;
|
|
33
|
-
message: string;
|
|
34
|
-
}
|
|
35
|
-
/** Matches an arabic (`12`) or roman (`iii`, `XIV`) number. */
|
|
36
|
-
export declare const ARABIC_OR_ROMAN: RegExp;
|
|
37
|
-
export declare const ATTRIBUTE_CONSTRAINTS: AttributeConstraint[];
|
|
38
|
-
export interface MetaConstraint {
|
|
39
|
-
/** meta[name=...] this rule applies to. */
|
|
40
|
-
name: string;
|
|
41
|
-
kind: 'digits' | 'isbn';
|
|
42
|
-
message: string;
|
|
43
|
-
}
|
|
44
|
-
export declare const META_CONSTRAINTS: MetaConstraint[];
|
|
45
|
-
/** True for an empty string or a string consisting only of arabic digits. */
|
|
46
|
-
export declare function isDigitsOnly(value: string): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Validates an ISBN-10 or ISBN-13 by format and checksum. Hyphens and spaces
|
|
49
|
-
* are ignored. An empty string is considered valid (field simply unset).
|
|
50
|
-
*/
|
|
51
|
-
export declare function isValidIsbn(value: string): boolean;
|
|
52
|
-
export interface HrefLinkType {
|
|
53
|
-
id: string;
|
|
54
|
-
label: string;
|
|
55
|
-
regex: RegExp;
|
|
56
|
-
description: string;
|
|
57
|
-
example: string;
|
|
58
|
-
}
|
|
59
|
-
export declare const HREF_LINK_TYPES: HrefLinkType[];
|
|
60
|
-
export declare function isValidHref(href: string): boolean;
|
|
61
|
-
export declare const DOCUMENT_RULES: {
|
|
62
|
-
html: {
|
|
63
|
-
requiredAttributes: string[];
|
|
64
|
-
dirEnumRef: string;
|
|
65
|
-
defaultDir: string;
|
|
66
|
-
};
|
|
67
|
-
head: {
|
|
68
|
-
requiredMeta: {
|
|
69
|
-
name: string;
|
|
70
|
-
description: string;
|
|
71
|
-
}[];
|
|
72
|
-
metaTypeName: string;
|
|
73
|
-
metaTypeEnumRef: string;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Verifies that every tag name referenced by the rules above exists in the
|
|
78
|
-
* generated TAGS map, so a docs rename that forgets to update this file is
|
|
79
|
-
* caught at activation time instead of silently breaking completions.
|
|
80
|
-
*/
|
|
81
|
-
export declare function checkStructureRules(): string[];
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type * as monaco from 'monaco-editor';
|
|
2
|
-
export interface WemlActionOptions {
|
|
3
|
-
/** Optional sink for the short status messages the VS Code extension shows in the status bar. */
|
|
4
|
-
onStatus?: (message: string) => void;
|
|
5
|
-
}
|
|
6
|
-
/** Wraps the current selection in `<tag [type=...]>…</tag>` (toolbar dropdown / hotkeys). */
|
|
7
|
-
export declare function wrapSelection(editor: monaco.editor.ICodeEditor, tag: string, type?: string): void;
|
|
8
|
-
/** Inserts a snippet by its toolbar-button id (composite label or plain tag). */
|
|
9
|
-
export declare function insertSnippetById(editor: monaco.editor.ICodeEditor, id: string): void;
|
|
10
|
-
/** Renumbers every `<div>` id in document order to a sequential 1..n. */
|
|
11
|
-
export declare function renumberDivIds(editor: monaco.editor.ICodeEditor, options?: WemlActionOptions): void;
|
|
12
|
-
/**
|
|
13
|
-
* Cycles the whole document between the standard HTML formatting (even steps) and
|
|
14
|
-
* the canonical WEML normalizer (odd steps). The step counter advances on every
|
|
15
|
-
* invocation, even when the formatter produces no change, so the cycle stays in
|
|
16
|
-
* sync — matching the VS Code `weml.cycleFormat` command.
|
|
17
|
-
*/
|
|
18
|
-
export declare function cycleFormat(editor: monaco.editor.ICodeEditor, options?: WemlActionOptions): void;
|
|
19
|
-
/**
|
|
20
|
-
* Registers the WEML editor actions on a specific editor instance: cycle-format
|
|
21
|
-
* (Alt+Shift+F), renumber div ids, and wrap-format bold/italic/underline
|
|
22
|
-
* (Ctrl+B / Ctrl+I / Ctrl+U). Returns an `IDisposable` that removes them.
|
|
23
|
-
*
|
|
24
|
-
* `editor.addAction` is per-editor (Monaco has no global command registry akin
|
|
25
|
-
* to the VS Code extension host), so call this for every WEML editor — or just
|
|
26
|
-
* use `createWemlToolbar`, which calls it for you.
|
|
27
|
-
*/
|
|
28
|
-
export declare function registerWemlEditorActions(m: typeof monaco, editor: monaco.editor.IStandaloneCodeEditor, options?: WemlActionOptions): monaco.IDisposable;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface IdEdit {
|
|
2
|
-
/** Replacement range in the source text (start === end means a pure insertion). */
|
|
3
|
-
start: number;
|
|
4
|
-
end: number;
|
|
5
|
-
newText: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Computes the edits needed to renumber every `<div>` id to its 1-based position
|
|
9
|
-
* in document order. Divs that already carry the right id produce no edit; a div
|
|
10
|
-
* without an `id` attribute gets one inserted right after the tag name.
|
|
11
|
-
*/
|
|
12
|
-
export declare function planDivIdRenumber(text: string): IdEdit[];
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type * as monaco from 'monaco-editor';
|
|
2
|
-
import { WemlActionOptions } from './actions';
|
|
3
|
-
export interface WemlToolbarOptions extends WemlActionOptions {
|
|
4
|
-
/** If given, the toolbar element is appended here. Otherwise it is only returned. */
|
|
5
|
-
container?: HTMLElement;
|
|
6
|
-
/** Include the (stub) search row, matching the VS Code toolbar. Default: true. */
|
|
7
|
-
includeSearchRow?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Handler for the search row. When omitted the row is a no-op stub (as in the
|
|
10
|
-
* VS Code extension). Receives the query text and the language code.
|
|
11
|
-
*/
|
|
12
|
-
onSearch?: (query: string, lang: string) => void;
|
|
13
|
-
}
|
|
14
|
-
export interface WemlToolbar extends monaco.IDisposable {
|
|
15
|
-
/** The toolbar's root DOM element. */
|
|
16
|
-
element: HTMLElement;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Builds the WEML toolbar for a Monaco editor and wires every button to the same
|
|
20
|
-
* operations as the VS Code toolbar (wrap selection, snippet insertion, renumber
|
|
21
|
-
* div ids). Also registers the editor actions/keybindings (Ctrl+B/I/U,
|
|
22
|
-
* Alt+Shift+F, renumber) via `registerWemlEditorActions`.
|
|
23
|
-
*
|
|
24
|
-
* Returns the root element plus a `dispose()` that removes the toolbar and its
|
|
25
|
-
* actions.
|
|
26
|
-
*/
|
|
27
|
-
export declare function createWemlToolbar(m: typeof monaco, editor: monaco.editor.IStandaloneCodeEditor, options?: WemlToolbarOptions): WemlToolbar;
|
package/dist/toolbar/wrap.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** Escapes text so it is inserted literally inside a SnippetString. */
|
|
2
|
-
export declare function escapeSnippet(text: string): string;
|
|
3
|
-
/**
|
|
4
|
-
* Builds a `<tag ...>SELECTION</tag>` snippet body for wrapping `selection`.
|
|
5
|
-
* - `type` (e.g. for `w-format`) fills `type="..."` directly.
|
|
6
|
-
* - `a` gets only `href="$1"` (it lists both href and id as required, but a
|
|
7
|
-
* wrapped selection is a link).
|
|
8
|
-
* - otherwise the tag's required attributes become `name="$1"` placeholders.
|
|
9
|
-
* An empty selection leaves a tab stop where the content goes.
|
|
10
|
-
*/
|
|
11
|
-
export declare function buildWrapSnippet(tag: string, type: string | undefined, selection: string): string;
|