|
@@ -313,7 +313,7 @@ describe("block decorations", () => {
|
|
|
expect(result.blocks[0].metadata?.level).toBe(1)
|
|
expect(result.blocks[0].metadata?.level).toBe(1)
|
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(2)
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(2)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 0,
|
|
from: 0,
|
|
|
to: 1,
|
|
to: 1,
|
|
|
className: "md-heading-marker",
|
|
className: "md-heading-marker",
|
|
@@ -333,7 +333,7 @@ describe("block decorations", () => {
|
|
|
expect(result.blocks[0].metadata?.level).toBe(3)
|
|
expect(result.blocks[0].metadata?.level).toBe(3)
|
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(2)
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(2)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 0,
|
|
from: 0,
|
|
|
to: 3,
|
|
to: 3,
|
|
|
className: "md-heading-marker",
|
|
className: "md-heading-marker",
|
|
@@ -352,7 +352,7 @@ describe("block decorations", () => {
|
|
|
expect(result.blocks[0].type).toBe("task")
|
|
expect(result.blocks[0].type).toBe("task")
|
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(2)
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(2)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 0,
|
|
from: 0,
|
|
|
to: 4,
|
|
to: 4,
|
|
|
className: "md-task-marker",
|
|
className: "md-task-marker",
|
|
@@ -372,7 +372,7 @@ describe("block decorations", () => {
|
|
|
expect(result.blocks[0].type).toBe("task")
|
|
expect(result.blocks[0].type).toBe("task")
|
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(2)
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(2)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 0,
|
|
from: 0,
|
|
|
to: 4,
|
|
to: 4,
|
|
|
className: "md-task-marker",
|
|
className: "md-task-marker",
|
|
@@ -434,7 +434,7 @@ describe("leading whitespace handling", () => {
|
|
|
const result = parseMarkdown(" # Title")
|
|
const result = parseMarkdown(" # Title")
|
|
|
expect(result.blocks).toHaveLength(1)
|
|
expect(result.blocks).toHaveLength(1)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 2,
|
|
from: 2,
|
|
|
to: 3,
|
|
to: 3,
|
|
|
className: "md-heading-marker",
|
|
className: "md-heading-marker",
|
|
@@ -451,7 +451,7 @@ describe("leading whitespace handling", () => {
|
|
|
const result = parseMarkdown(" TODO buy milk")
|
|
const result = parseMarkdown(" TODO buy milk")
|
|
|
expect(result.blocks).toHaveLength(1)
|
|
expect(result.blocks).toHaveLength(1)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 2,
|
|
from: 2,
|
|
|
to: 6,
|
|
to: 6,
|
|
|
className: "md-task-marker",
|
|
className: "md-task-marker",
|
|
@@ -469,7 +469,7 @@ describe("leading whitespace handling", () => {
|
|
|
expect(result.blocks).toHaveLength(1)
|
|
expect(result.blocks).toHaveLength(1)
|
|
|
expect(result.blocks[0].type).toBe("task")
|
|
expect(result.blocks[0].type).toBe("task")
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 2,
|
|
from: 2,
|
|
|
to: 6,
|
|
to: 6,
|
|
|
className: "md-task-marker",
|
|
className: "md-task-marker",
|
|
@@ -486,7 +486,7 @@ describe("leading whitespace handling", () => {
|
|
|
const result = parseMarkdown(" > Quote text")
|
|
const result = parseMarkdown(" > Quote text")
|
|
|
expect(result.blocks).toHaveLength(1)
|
|
expect(result.blocks).toHaveLength(1)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 2,
|
|
from: 2,
|
|
|
to: 3,
|
|
to: 3,
|
|
|
className: "md-marker",
|
|
className: "md-marker",
|
|
@@ -497,7 +497,7 @@ describe("leading whitespace handling", () => {
|
|
|
const result = parseMarkdown(" > [!NOTE] important")
|
|
const result = parseMarkdown(" > [!NOTE] important")
|
|
|
expect(result.blocks).toHaveLength(1)
|
|
expect(result.blocks).toHaveLength(1)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 2,
|
|
from: 2,
|
|
|
to: 11,
|
|
to: 11,
|
|
|
className: "md-marker",
|
|
className: "md-marker",
|
|
@@ -510,7 +510,7 @@ describe("whitespace variations in task rules", () => {
|
|
|
const result = parseMarkdown("TODO buy milk")
|
|
const result = parseMarkdown("TODO buy milk")
|
|
|
expect(result.blocks).toHaveLength(1)
|
|
expect(result.blocks).toHaveLength(1)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 0,
|
|
from: 0,
|
|
|
to: 4,
|
|
to: 4,
|
|
|
className: "md-task-marker",
|
|
className: "md-task-marker",
|
|
@@ -536,7 +536,7 @@ describe("whitespace variations in task rules", () => {
|
|
|
const result = parseMarkdown("# Title")
|
|
const result = parseMarkdown("# Title")
|
|
|
expect(result.blocks).toHaveLength(1)
|
|
expect(result.blocks).toHaveLength(1)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 0,
|
|
from: 0,
|
|
|
to: 1,
|
|
to: 1,
|
|
|
className: "md-heading-marker",
|
|
className: "md-heading-marker",
|
|
@@ -553,7 +553,7 @@ describe("whitespace variations in task rules", () => {
|
|
|
const result = parseMarkdown("TODO buy milk")
|
|
const result = parseMarkdown("TODO buy milk")
|
|
|
expect(result.blocks).toHaveLength(1)
|
|
expect(result.blocks).toHaveLength(1)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 0,
|
|
from: 0,
|
|
|
to: 4,
|
|
to: 4,
|
|
|
className: "md-task-marker",
|
|
className: "md-task-marker",
|
|
@@ -676,7 +676,7 @@ describe("wrapperAttrs output", () => {
|
|
|
expect(result.blocks[0].type).toBe("blockquote")
|
|
expect(result.blocks[0].type).toBe("blockquote")
|
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(1)
|
|
expect(result.blocks[0].decorationRanges).toHaveLength(1)
|
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
expect(result.blocks[0].decorationRanges[0]).toEqual({
|
|
|
- type: "content",
|
|
|
|
|
|
|
+ type: "hidden",
|
|
|
from: 0,
|
|
from: 0,
|
|
|
to: 1,
|
|
to: 1,
|
|
|
className: "md-marker",
|
|
className: "md-marker",
|