markdown strikethrough

This commit is contained in:
Alexander Wang 2023-03-18 13:59:19 -07:00
parent 9e65f72952
commit 56a4ee5fff
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
7 changed files with 204 additions and 195 deletions

View file

@ -1,6 +1,7 @@
#### Features 🚀 #### Features 🚀
- `--center` flag centers the SVG in the containing viewbox. [#1056](https://github.com/terrastruct/d2/pull/1056) - `--center` flag centers the SVG in the containing viewbox. [#1056](https://github.com/terrastruct/d2/pull/1056)
- Strikethrough in Markdown with `~~`. [#1059](https://github.com/terrastruct/d2/pull/1059)
#### Improvements 🧹 #### Improvements 🧹

View file

@ -805,6 +805,8 @@ ww -> ff.gg
- Visits always give pleasure: if not on arrival, then on the departure - Visits always give pleasure: if not on arrival, then on the departure
*Festivity Level 1*: Your guests are chatting amiably with each other. *Festivity Level 1*: Your guests are chatting amiably with each other.
test ~~strikethrough~~ test
| |
x -> hey -> y x -> hey -> y

View file

@ -11,7 +11,7 @@
"y": 166 "y": 166
}, },
"width": 531, "width": 531,
"height": 187, "height": 227,
"opacity": 1, "opacity": 1,
"strokeDash": 0, "strokeDash": 0,
"strokeWidth": 2, "strokeWidth": 2,
@ -30,7 +30,7 @@
"fields": null, "fields": null,
"methods": null, "methods": null,
"columns": null, "columns": null,
"label": "# Every frustum longs to be a cone\n\n- A continuing flow of paper is sufficient to continue the flow of paper\n- Please remain calm, it's no use both of us being hysterical at the same time\n- Visits always give pleasure: if not on arrival, then on the departure\n\n*Festivity Level 1*: Your guests are chatting amiably with each other.", "label": "# Every frustum longs to be a cone\n\n- A continuing flow of paper is sufficient to continue the flow of paper\n- Please remain calm, it's no use both of us being hysterical at the same time\n- Visits always give pleasure: if not on arrival, then on the departure\n\n*Festivity Level 1*: Your guests are chatting amiably with each other.\n\ntest ~~strikethrough~~ test",
"fontSize": 16, "fontSize": 16,
"fontFamily": "DEFAULT", "fontFamily": "DEFAULT",
"language": "markdown", "language": "markdown",
@ -39,7 +39,7 @@
"bold": false, "bold": false,
"underline": false, "underline": false,
"labelWidth": 531, "labelWidth": 531,
"labelHeight": 187, "labelHeight": 227,
"zIndex": 0, "zIndex": 0,
"level": 1 "level": 1
}, },
@ -89,7 +89,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 239, "x": 239,
"y": 453 "y": 493
}, },
"width": 54, "width": 54,
"height": 66, "height": 66,
@ -202,21 +202,21 @@
"labelPosition": "", "labelPosition": "",
"labelPercentage": 0, "labelPercentage": 0,
"route": [ "route": [
{
"x": 265.5,
"y": 353
},
{ {
"x": 265.5, "x": 265.5,
"y": 393 "y": 393
}, },
{ {
"x": 265.5, "x": 265.5,
"y": 413 "y": 433
}, },
{ {
"x": 265.5, "x": 265.5,
"y": 453 "y": 453
},
{
"x": 265.5,
"y": 493
} }
], ],
"isCurve": true, "isCurve": true,

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 808 KiB

After

Width:  |  Height:  |  Size: 808 KiB

View file

@ -11,7 +11,7 @@
"y": 148 "y": 148
}, },
"width": 531, "width": 531,
"height": 187, "height": 227,
"opacity": 1, "opacity": 1,
"strokeDash": 0, "strokeDash": 0,
"strokeWidth": 2, "strokeWidth": 2,
@ -30,7 +30,7 @@
"fields": null, "fields": null,
"methods": null, "methods": null,
"columns": null, "columns": null,
"label": "# Every frustum longs to be a cone\n\n- A continuing flow of paper is sufficient to continue the flow of paper\n- Please remain calm, it's no use both of us being hysterical at the same time\n- Visits always give pleasure: if not on arrival, then on the departure\n\n*Festivity Level 1*: Your guests are chatting amiably with each other.", "label": "# Every frustum longs to be a cone\n\n- A continuing flow of paper is sufficient to continue the flow of paper\n- Please remain calm, it's no use both of us being hysterical at the same time\n- Visits always give pleasure: if not on arrival, then on the departure\n\n*Festivity Level 1*: Your guests are chatting amiably with each other.\n\ntest ~~strikethrough~~ test",
"fontSize": 16, "fontSize": 16,
"fontFamily": "DEFAULT", "fontFamily": "DEFAULT",
"language": "markdown", "language": "markdown",
@ -39,7 +39,7 @@
"bold": false, "bold": false,
"underline": false, "underline": false,
"labelWidth": 531, "labelWidth": 531,
"labelHeight": 187, "labelHeight": 227,
"zIndex": 0, "zIndex": 0,
"level": 1 "level": 1
}, },
@ -89,7 +89,7 @@
"type": "rectangle", "type": "rectangle",
"pos": { "pos": {
"x": 250, "x": 250,
"y": 405 "y": 445
}, },
"width": 54, "width": 54,
"height": 66, "height": 66,
@ -195,11 +195,11 @@
"route": [ "route": [
{ {
"x": 277.5, "x": 277.5,
"y": 335 "y": 375
}, },
{ {
"x": 277.5, "x": 277.5,
"y": 405 "y": 445
} }
], ],
"animated": false, "animated": false,

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 808 KiB

After

Width:  |  Height:  |  Size: 808 KiB

View file

@ -8,6 +8,7 @@ import (
"github.com/PuerkitoBio/goquery" "github.com/PuerkitoBio/goquery"
"github.com/yuin/goldmark" "github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
goldmarkHtml "github.com/yuin/goldmark/renderer/html" goldmarkHtml "github.com/yuin/goldmark/renderer/html"
"golang.org/x/net/html" "golang.org/x/net/html"
@ -82,6 +83,9 @@ func init() {
goldmarkHtml.WithUnsafe(), goldmarkHtml.WithUnsafe(),
goldmarkHtml.WithXHTML(), goldmarkHtml.WithXHTML(),
), ),
goldmark.WithExtensions(
extension.Strikethrough,
),
) )
} }