rapier-markdown-kit 1.1.4 → 1.1.14
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/LICENSE +1 -1
- package/README.md +1 -0
- package/dist/spec/md-layout.mjs +8 -1
- package/package.json +1 -1
- package/style.css +3 -2
package/LICENSE
CHANGED
|
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
21
21
|
SOFTWARE.
|
|
22
22
|
|
|
23
23
|
Files under this licence carry `SPDX-License-Identifier: MIT` in their first lines: the standard's
|
|
24
|
-
grammar, marks and reference style (`spec/md-layout.mjs`, `spec/md-marks.mjs`, `spec/markdown-style.css`), the layout model and line planner
|
|
24
|
+
grammar, marks and reference style (`spec/md-layout.mjs`, `spec/md-marks.mjs`, `spec/flowchart.mjs`, `spec/markdown-style.css`), the layout model and line planner
|
|
25
25
|
(`layout/model.mjs`, `layout/line-plan.mjs`), the Will grammar (`agent/will.mjs`), the picture appendix reader and writer
|
|
26
26
|
(`spec/md-assets.mjs`), the two shared-page reference readers (`tools/read-shared-page.mjs`,
|
|
27
27
|
`tools/read-shared-page.py`), and the host helper `packages/rapier-embed/embed.mjs`. The vendored Pretext (`agent/vendor/pretext`) and micromark carry their
|
package/README.md
CHANGED
|
@@ -64,6 +64,7 @@ below belongs to the example, not to the package API.
|
|
|
64
64
|
The example renders trusted Markdown, including its HTML. It demonstrates core Markdown, GFM tables,
|
|
65
65
|
an aligned paragraph, a sized picture, a named text colour and a page break. Tasks,
|
|
66
66
|
footnotes and other extensions use the caller's Markdown plugins; details use ordinary HTML.
|
|
67
|
+
In a Rapier page, supported Mermaid flowchart fences also draw offline in Rapier's look, so an agent can write a fence or use figures. The kit itself does not render diagrams.
|
|
67
68
|
The complete markup contract, including callouts, diagrams, math and image wrapping, is
|
|
68
69
|
[Reference style](https://github.com/jackskip22/rapier/blob/main/docs/markdown-standard.md#reference-style).
|
|
69
70
|
|
package/dist/spec/md-layout.mjs
CHANGED
|
@@ -83,7 +83,14 @@ export function imageStyle(value) {
|
|
|
83
83
|
return parts.join(';');
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
//
|
|
86
|
+
// Controls remain real DOM nodes while their surrounding text flows. A checkbox, link or
|
|
87
|
+
// disclosure is not a reason to exclude its entire block from picture placement.
|
|
88
|
+
export function wrapTextBlock(element) {
|
|
89
|
+
return element && /^(P|H[1-6]|UL|OL|BLOCKQUOTE|DETAILS|DL)$/.test(element.tagName) &&
|
|
90
|
+
element.textContent.trim() && !element.querySelector('img,table,pre,figure,math,.math-rendered') ? element : null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// The one wrap-owner rule (layout/browser.js, layout/interchange.js, editor/share.js): text after, else before, skipping pictures,
|
|
87
94
|
// metadata and empty paragraphs; any other block is a barrier in that direction.
|
|
88
95
|
export function wrapNeighbour(node, classify) {
|
|
89
96
|
for (const step of [n => n && n.nextElementSibling, n => n && n.previousElementSibling]) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapier-markdown-kit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"description": "Read, write and style Self-contained Markdown: the universal stylesheet, picture layout, text marks, picture appendix, line planner and Will/1 markers. MIT, no dependencies.",
|
|
5
5
|
"author": "Jack Skipworth",
|
|
6
6
|
"license": "MIT",
|
package/style.css
CHANGED
|
@@ -159,6 +159,7 @@
|
|
|
159
159
|
The same class reaches rendered blocks and source previews: the owner
|
|
160
160
|
marks each admitted drawing `rapier-diagram`, which remains stable when export namespaces
|
|
161
161
|
local SVG IDs and references. */
|
|
162
|
+
:where(.md-render) svg.rapier-native-flowchart{display:block;margin-inline:auto;height:auto}
|
|
162
163
|
:where(.md-render) svg.rapier-diagram{
|
|
163
164
|
display:block;margin-inline:auto;height:auto;
|
|
164
165
|
font-family:var(--md-font-sans)!important;
|
|
@@ -334,7 +335,7 @@
|
|
|
334
335
|
/* Paper cannot be scrolled sideways, so on paper a diagram, and a wide drawing, go back to fitting the page. */
|
|
335
336
|
@media print{
|
|
336
337
|
:where(.md-render) .diagram-block{overflow:visible!important}
|
|
337
|
-
:where(.md-render) svg.rapier-diagram{width:auto!important;max-width:100%!important}
|
|
338
|
+
:where(.md-render) svg.rapier-diagram,:where(.md-render) svg.rapier-native-flowchart{width:auto!important;max-width:100%!important}
|
|
338
339
|
.md-render img[data-md-drawing]{min-width:0!important}
|
|
339
340
|
.md-render :has(>img[data-md-drawing],>a>img[data-md-drawing]){overflow:visible!important}
|
|
340
341
|
}
|
|
@@ -352,7 +353,7 @@
|
|
|
352
353
|
line-height:var(--md-leading-tight);color:var(--md-heading-color);text-wrap:balance}
|
|
353
354
|
.md-render h1{font-size:2.8rem;font-weight:700;
|
|
354
355
|
margin:var(--md-space-6) 0 var(--md-space-4);
|
|
355
|
-
padding-bottom:var(--md-space-3)
|
|
356
|
+
padding-bottom:var(--md-space-3)}
|
|
356
357
|
.md-render h2{font-size:2.2rem;font-weight:600;margin:var(--md-space-6) 0 var(--md-space-3)}
|
|
357
358
|
.md-render h3{font-size:1.7rem;font-weight:600;margin:var(--md-space-5) 0 var(--md-space-2)}
|
|
358
359
|
.md-render h4{font-size:1.3rem;font-weight:500;margin:var(--md-space-4) 0 var(--md-space-2)}
|