@xlxz/markdown-editor 2.2.0 → 2.2.1

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/index.cjs CHANGED
@@ -1624,9 +1624,14 @@ function createCalloutExtension() {
1624
1624
  if (match) {
1625
1625
  const title = match[1]?.trim();
1626
1626
  const label = title || capitalizeFirst(callout.type);
1627
+ const prefixMatch = text.match(/^>\s?/);
1628
+ const prefixLen = prefixMatch ? prefixMatch[0].length : 0;
1629
+ if (prefixLen > 0) {
1630
+ builder.push(Decoration.mark({ class: "cm-callout-hide" }).range(line.from, line.from + prefixLen));
1631
+ }
1627
1632
  builder.push(Decoration.replace({
1628
1633
  widget: new CalloutHeaderWidget(callout.type, label)
1629
- }).range(line.from, line.to));
1634
+ }).range(line.from + prefixLen, line.to));
1630
1635
  }
1631
1636
  } else if (lineNum !== callout.firstLine && !isLineActive) {
1632
1637
  const text = line.text;
package/dist/index.js CHANGED
@@ -1569,9 +1569,14 @@ function createCalloutExtension() {
1569
1569
  if (match) {
1570
1570
  const title = match[1]?.trim();
1571
1571
  const label = title || capitalizeFirst(callout.type);
1572
+ const prefixMatch = text.match(/^>\s?/);
1573
+ const prefixLen = prefixMatch ? prefixMatch[0].length : 0;
1574
+ if (prefixLen > 0) {
1575
+ builder.push(Decoration.mark({ class: "cm-callout-hide" }).range(line.from, line.from + prefixLen));
1576
+ }
1572
1577
  builder.push(Decoration.replace({
1573
1578
  widget: new CalloutHeaderWidget(callout.type, label)
1574
- }).range(line.from, line.to));
1579
+ }).range(line.from + prefixLen, line.to));
1575
1580
  }
1576
1581
  } else if (lineNum !== callout.firstLine && !isLineActive) {
1577
1582
  const text = line.text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xlxz/markdown-editor",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Obsidian-quality Markdown live preview editor — microkernel + plugin architecture. Internal use.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",