flinker-markdown 1.1.1 → 1.1.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/dist/esm/md.js +5 -3
- package/dist/types/md.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/md.js
CHANGED
|
@@ -61,12 +61,14 @@ export class MDGrammar {
|
|
|
61
61
|
this.figure = new MDInlineGrammarRule();
|
|
62
62
|
this.figure.matcher = [/!\[([^\]]+)\]\(([^)]+)\)\(([^)]+)\)/gm, '<figure><img alt="$1" src="$2"/><figcaption>$3</figcaption></figure>'];
|
|
63
63
|
this.img = new MDInlineGrammarRule();
|
|
64
|
-
this.img.matcher = [
|
|
64
|
+
this.img.matcher = [/\[img:([^ ]+) ?([^\]]*)\]/gm, '<img src="$1" alt="$2"/>'];
|
|
65
65
|
this.link = new MDInlineGrammarRule();
|
|
66
|
-
this.link.matcher = [/\[([^\]]*)\]
|
|
66
|
+
this.link.matcher = [/\[link:([^ ]+) ?([^\]]*)\]/, (line, url, descr) => {
|
|
67
67
|
return '<a href="' + url + '">' + (descr || url) + '</a>';
|
|
68
68
|
}];
|
|
69
|
-
this.
|
|
69
|
+
this.audio = new MDInlineGrammarRule();
|
|
70
|
+
this.audio.matcher = [/\[audio:([^\]]+)\]/, '<audio controls src="$1"></audio>'];
|
|
71
|
+
this.globalRule.childrenInlineRules = [this.code, this.figure, this.img, this.link, this.audio, this.sub, this.sup, this.strong, this.boldItalic, this.bold, this.em, this.italic];
|
|
70
72
|
//
|
|
71
73
|
// LINE GRAMMAR RULES
|
|
72
74
|
//
|
package/dist/types/md.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare class MDGrammar {
|
|
|
35
35
|
readonly figure: MDInlineGrammarRule;
|
|
36
36
|
readonly img: MDInlineGrammarRule;
|
|
37
37
|
readonly link: MDInlineGrammarRule;
|
|
38
|
+
readonly audio: MDInlineGrammarRule;
|
|
38
39
|
readonly header: MDLineGrammarRule;
|
|
39
40
|
readonly quote: MDLineGrammarRule;
|
|
40
41
|
readonly alignRight: MDLineGrammarRule;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flinker-markdown",
|
|
3
3
|
"description": "Free TypeScript library for parsing markdown text (customisable, not standardized).",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/Dittner/FlinkerMD.git"
|