diff --git a/packages/@atjson/offset-annotations/src/utils/convert-html-tables.ts b/packages/@atjson/offset-annotations/src/utils/convert-html-tables.ts
index b99169b47..095fb569e 100644
--- a/packages/@atjson/offset-annotations/src/utils/convert-html-tables.ts
+++ b/packages/@atjson/offset-annotations/src/utils/convert-html-tables.ts
@@ -16,7 +16,7 @@ export function convertHTMLTablesToDataSet(
slice: string;
type: ColumnType;
}[] = [];
- let columnConfigs: Table["attributes"]["columns"] = [];
+ let columnConfigs: Exclude
= [];
let dataRows: Record[] = [];
let slices: SliceAnnotation[] = [];
@@ -45,7 +45,10 @@ export function convertHTMLTablesToDataSet(
attributes: { refs: [] },
});
doc.replaceAnnotation(headCell, slice);
- let columnName = doc.content.slice(slice.start, slice.end).trim();
+ let columnName = doc.content
+ .slice(slice.start, slice.end)
+ .replace(/[^\p{Letter}\p{White_Space}]/gu, "")
+ .replace(/\s+/, " ");
dataColumnHeaders.push({
slice: slice.id,
name: columnName.length ? columnName : `column ${index + 1}`,
@@ -59,11 +62,15 @@ export function convertHTMLTablesToDataSet(
);
if (groups?.alignment) {
- columnConfigs?.push({
+ columnConfigs.push({
name: columnName,
- textAlign: groups.alignment as "left" | "right" | "center",
+ textAlign: groups?.alignment as "left" | "right" | "center",
});
+ } else {
+ columnConfigs.push({ name: columnName });
}
+ } else {
+ columnConfigs.push({ name: columnName });
}
});
@@ -134,7 +141,7 @@ export function convertHTMLTablesToDataSet(
attributes: { dataSet: dataSet.id },
});
- if (columnConfigs?.length) {
+ if (columnConfigs.length) {
offsetTable.attributes.columns = columnConfigs;
}
diff --git a/packages/@atjson/renderer-commonmark/test/__snapshots__/table.test.ts.snap b/packages/@atjson/renderer-commonmark/test/__snapshots__/table.test.ts.snap
new file mode 100644
index 000000000..a8f5d34ed
--- /dev/null
+++ b/packages/@atjson/renderer-commonmark/test/__snapshots__/table.test.ts.snap
@@ -0,0 +1,41 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`tables with column headings center alignment 1`] = `
+"| column 1 | column 2 |
+|:--------:| -------- |
+| data 1.1 | data 1.2 |
+
+"
+`;
+
+exports[`tables with column headings mixed alignment 1`] = `
+"| column 1 | column 2 |
+|:-------- | --------:|
+| data 1.1 | data 1.2 |
+
+"
+`;
+
+exports[`tables with column headings no alignment 1`] = `
+"| column 1 | column 2 |
+| -------- | -------- |
+| data 1.1 | data 1.2 |
+
+"
+`;
+
+exports[`tables with column headings omitting columns 1`] = `
+"| column 2 |
+| -------- |
+| data 1.2 |
+
+"
+`;
+
+exports[`tables with column headings reordering columns 1`] = `
+"| column 2 | column 1 |
+| -------- | -------- |
+| data 1.2 | data 1.1 |
+
+"
+`;
diff --git a/packages/@atjson/renderer-commonmark/test/__snapshots__/tables.test.ts.snap b/packages/@atjson/renderer-commonmark/test/__snapshots__/tables.test.ts.snap
deleted file mode 100644
index fe70b9b8d..000000000
--- a/packages/@atjson/renderer-commonmark/test/__snapshots__/tables.test.ts.snap
+++ /dev/null
@@ -1,9 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`tables with column headings 1`] = `
-"| column 1 | column 2 |
-| :-- | --: |
-| data 1.1 | data 1.2 |
-
-"
-`;
diff --git a/packages/@atjson/renderer-commonmark/test/table.test.ts b/packages/@atjson/renderer-commonmark/test/table.test.ts
new file mode 100644
index 000000000..1543c9686
--- /dev/null
+++ b/packages/@atjson/renderer-commonmark/test/table.test.ts
@@ -0,0 +1,179 @@
+import { Block, deserialize } from "@atjson/document";
+import OffsetSource, { Table } from "@atjson/offset-annotations";
+import CommonmarkRenderer from "../src";
+
+function testTable(tableAttributes: Block["attributes"]) {
+ return deserialize(
+ {
+ text: "column 1 column 2 data 1.1 data 1.2",
+ blocks: [
+ {
+ type: "table",
+ id: "tableId",
+ attributes: tableAttributes,
+ parents: [],
+ },
+ {
+ type: "data-set",
+ id: "dataSetId",
+ attributes: {
+ columns: [
+ {
+ name: "column 1",
+ slice: "column1Id",
+ type: "peritext",
+ },
+ {
+ name: "column 2",
+ slice: "column2Id",
+ type: "peritext",
+ },
+ ],
+ rows: [
+ {
+ "column 1": {
+ slice: "cell1_1Id",
+ jsonValue: "data 1.1",
+ },
+ "column 2": {
+ slice: "cell1_2Id",
+ jsonValue: "data 1.2",
+ },
+ },
+ ],
+ },
+ parents: ["table"],
+ },
+ ],
+ marks: [
+ {
+ attributes: {
+ refs: ["dataSetId"],
+ },
+ id: "column1Id",
+ range: "(2..10]",
+ type: "slice",
+ },
+ {
+ attributes: {
+ refs: ["dataSetId"],
+ },
+ id: "column2Id",
+ range: "(11..19]",
+ type: "slice",
+ },
+ {
+ attributes: {
+ refs: ["dataSetId"],
+ },
+ id: "cell1_1Id",
+ range: "(20..28]",
+ type: "slice",
+ },
+ {
+ attributes: {
+ refs: ["dataSetId"],
+ },
+ id: "cell1_2Id",
+ range: "(29..37]",
+ type: "slice",
+ },
+ ],
+ },
+ OffsetSource
+ );
+}
+
+describe("tables", () => {
+ describe("with column headings", () => {
+ test("no alignment", () => {
+ let document = testTable({
+ columns: [
+ {
+ name: "column 1",
+ },
+ {
+ name: "column 2",
+ },
+ ],
+ dataSet: "dataSetId",
+ showColumnHeaders: true,
+ });
+
+ const markdown = CommonmarkRenderer.render(document);
+ expect(markdown).toMatchSnapshot();
+ });
+
+ test("mixed alignment", () => {
+ let document = testTable({
+ columns: [
+ {
+ name: "column 1",
+ textAlign: "left",
+ },
+ {
+ name: "column 2",
+ textAlign: "right",
+ },
+ ],
+ dataSet: "dataSetId",
+ showColumnHeaders: true,
+ });
+
+ const markdown = CommonmarkRenderer.render(document);
+ expect(markdown).toMatchSnapshot();
+ });
+
+ test("center alignment", () => {
+ let document = testTable({
+ columns: [
+ {
+ name: "column 1",
+ textAlign: "center",
+ },
+ {
+ name: "column 2",
+ },
+ ],
+ dataSet: "dataSetId",
+ showColumnHeaders: true,
+ });
+
+ const markdown = CommonmarkRenderer.render(document);
+ expect(markdown).toMatchSnapshot();
+ });
+
+ test("reordering columns", () => {
+ let document = testTable({
+ columns: [
+ {
+ name: "column 2",
+ },
+ {
+ name: "column 1",
+ },
+ ],
+ dataSet: "dataSetId",
+ showColumnHeaders: true,
+ });
+
+ const markdown = CommonmarkRenderer.render(document);
+ expect(markdown).toMatchSnapshot();
+ });
+
+ test("omitting columns", () => {
+ let document = testTable({
+ columns: [
+ {
+ name: "column 2",
+ },
+ ],
+ dataSet: "dataSetId",
+ showColumnHeaders: true,
+ });
+
+ const markdown = CommonmarkRenderer.render(document);
+ expect(markdown).toMatchSnapshot();
+ });
+ });
+});
diff --git a/packages/@atjson/renderer-commonmark/test/tables.test.ts b/packages/@atjson/renderer-commonmark/test/tables.test.ts
deleted file mode 100644
index f30b17730..000000000
--- a/packages/@atjson/renderer-commonmark/test/tables.test.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-import { deserialize } from "@atjson/document";
-import OffsetSource from "@atjson/offset-annotations";
-import CommonmarkRenderer from "../src";
-
-describe("tables", () => {
- test("with column headings", () => {
- let document = deserialize(
- {
- text: "column 1 column 2 data 1.1 data 1.2",
- blocks: [
- {
- type: "data-set",
- id: "dataSetId",
- attributes: {
- columns: [
- {
- name: "column 1",
- slice: "column1Id",
- type: "peritext",
- },
- {
- name: "column 2",
- slice: "column2Id",
- type: "peritext",
- },
- ],
- rows: [
- {
- "column 1": {
- slice: "cell1_1Id",
- jsonValue: "data 1.1",
- },
- "column 2": {
- slice: "cell1_2Id",
- jsonValue: "data 1.2",
- },
- },
- ],
- },
- parents: ["table"],
- },
- {
- type: "table",
- id: "tableId",
- attributes: {
- columns: [
- {
- name: "column 1",
- textAlign: "left",
- },
- {
- name: "column 2",
- textAlign: "right",
- },
- ],
- dataSet: "dataSetId",
- showColumnHeaders: true,
- },
- parents: [],
- },
- ],
- marks: [
- {
- attributes: {
- refs: ["dataSetId"],
- },
- id: "column1Id",
- range: "(2..10]",
- type: "slice",
- },
- {
- attributes: {
- refs: ["dataSetId"],
- },
- id: "column2Id",
- range: "(11..19]",
- type: "slice",
- },
- {
- attributes: {
- refs: ["dataSetId"],
- },
- id: "cell1_1Id",
- range: "(20..28]",
- type: "slice",
- },
- {
- attributes: {
- refs: ["dataSetId"],
- },
- id: "cell1_2Id",
- range: "(29..37]",
- type: "slice",
- },
- ],
- },
- OffsetSource
- );
-
- const markdown = CommonmarkRenderer.render(document);
- expect(markdown).toMatchSnapshot();
- });
-});
diff --git a/packages/@atjson/source-commonmark/test/__snapshots__/extensions.test.ts.snap b/packages/@atjson/source-commonmark/test/__snapshots__/extensions.test.ts.snap
index 5afa88fa7..d0a1fb6f1 100644
--- a/packages/@atjson/source-commonmark/test/__snapshots__/extensions.test.ts.snap
+++ b/packages/@atjson/source-commonmark/test/__snapshots__/extensions.test.ts.snap
@@ -7,35 +7,97 @@ exports[`tables converting 1`] = `
"attributes": {
"columns": [
{
- "name": "name",
+ "name": "name",
"slice": "M00000000",
"type": "peritext",
},
{
- "name": "age",
+ "name": "age",
"slice": "M00000001",
"type": "peritext",
},
+ {
+ "name": "job",
+ "slice": "M00000002",
+ "type": "peritext",
+ },
+ {
+ "name": "notes",
+ "slice": "M00000005",
+ "type": "peritext",
+ },
],
"rows": [
{
- "age": {
+ "age": {
"jsonValue": "20",
- "slice": "M00000003",
+ "slice": "M00000007",
},
- "name": {
+ "job": {
+ "jsonValue": "fighter",
+ "slice": "M00000008",
+ },
+ "name": {
"jsonValue": "laios",
- "slice": "M00000002",
+ "slice": "M00000006",
+ },
+ "notes": {
+ "jsonValue": "A strange but earnest person. He really really likes monsters",
+ "slice": "M00000009",
},
},
{
- "age": {
+ "age": {
"jsonValue": "500",
- "slice": "M00000005",
+ "slice": "M0000000d",
+ },
+ "job": {
+ "jsonValue": "mage",
+ "slice": "M0000000e",
},
- "name": {
+ "name": {
"jsonValue": "marcille",
- "slice": "M00000004",
+ "slice": "M0000000c",
+ },
+ "notes": {
+ "jsonValue": "Difficult to get along with but very competent. Despite seeming strict and fussy, she is interested in forbidden magic...",
+ "slice": "M0000000f",
+ },
+ },
+ {
+ "age": {
+ "jsonValue": "18",
+ "slice": "M00000011",
+ },
+ "job": {
+ "jsonValue": "healer",
+ "slice": "M00000012",
+ },
+ "name": {
+ "jsonValue": "falin",
+ "slice": "M00000010",
+ },
+ "notes": {
+ "jsonValue": "She seems nice, but is actually just a people pleaser. When push comes to shove she will look out for people she loves and disregard strangers",
+ "slice": "M00000013",
+ },
+ },
+ {
+ "age": {
+ "jsonValue": "29",
+ "slice": "M00000016",
+ },
+ "job": {
+ "jsonValue": "thief",
+ "slice": "M00000017",
+ },
+ "name": {
+ "jsonValue": "chilchuk",
+ "slice": "M00000015",
+ },
+ "notes": {
+ "jsonValue": "Looks like a child but is actually a divorced father of three. He is serious about his work and isn't interested in getting close with people",
+ "slice": "M00000018",
},
},
],
@@ -47,6 +109,20 @@ exports[`tables converting 1`] = `
},
{
"attributes": {
+ "columns": [
+ {
+ "name": "name",
+ "textAlign": "left",
+ },
+ {
+ "name": "age",
+ "textAlign": "right",
+ },
+ {
+ "name": "notes",
+ "textAlign": "center",
+ },
+ ],
"dataSet": "B00000000",
},
"id": "B00000001",
@@ -85,17 +161,31 @@ exports[`tables converting 1`] = `
],
},
"id": "M00000002",
- "range": "(12..17]",
+ "range": "(12..15]",
"type": "slice",
},
+ {
+ "attributes": {
+ "url": "https://en.wikipedia.org/wiki/Delicious_in_Dungeon",
+ },
+ "id": "M00000003",
+ "range": "(16..21)",
+ "type": "link",
+ },
+ {
+ "attributes": {},
+ "id": "M00000004",
+ "range": "(16..21]",
+ "type": "italic",
+ },
{
"attributes": {
"refs": [
"B00000000",
],
},
- "id": "M00000003",
- "range": "(18..20]",
+ "id": "M00000005",
+ "range": "(16..21]",
"type": "slice",
},
{
@@ -104,8 +194,8 @@ exports[`tables converting 1`] = `
"B00000000",
],
},
- "id": "M00000004",
- "range": "(21..29]",
+ "id": "M00000006",
+ "range": "(22..27]",
"type": "slice",
},
{
@@ -114,12 +204,170 @@ exports[`tables converting 1`] = `
"B00000000",
],
},
- "id": "M00000005",
- "range": "(30..33]",
+ "id": "M00000007",
+ "range": "(28..30]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000008",
+ "range": "(31..38]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000009",
+ "range": "(39..100]",
+ "type": "slice",
+ },
+ {
+ "attributes": {},
+ "id": "M0000000a",
+ "range": "(72..85]",
+ "type": "italic",
+ },
+ {
+ "attributes": {},
+ "id": "M0000000b",
+ "range": "(79..85]",
+ "type": "bold",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M0000000c",
+ "range": "(101..109]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M0000000d",
+ "range": "(110..113]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M0000000e",
+ "range": "(114..118]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M0000000f",
+ "range": "(119..240]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000010",
+ "range": "(241..246]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000011",
+ "range": "(247..249]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000012",
+ "range": "(250..256]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000013",
+ "range": "(257..399]",
+ "type": "slice",
+ },
+ {
+ "attributes": {},
+ "id": "M00000014",
+ "range": "(261..266]",
+ "type": "italic",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000015",
+ "range": "(400..408]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000016",
+ "range": "(409..411]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000017",
+ "range": "(412..417]",
+ "type": "slice",
+ },
+ {
+ "attributes": {
+ "refs": [
+ "B00000000",
+ ],
+ },
+ "id": "M00000018",
+ "range": "(418..559]",
"type": "slice",
},
],
- "text": " name age laios 20 marcille 500",
+ "text": " name age job notes laios 20 fighter A strange but earnest person. He really really likes monsters marcille 500 mage Difficult to get along with but very competent. Despite seeming strict and fussy, she is interested in forbidden magic... falin 18 healer She seems nice, but is actually just a people pleaser. When push comes to shove she will look out for people she loves and disregard strangers chilchuk 29 thief Looks like a child but is actually a divorced father of three. He is serious about his work and isn't interested in getting close with people",
}
`;
@@ -153,7 +401,9 @@ exports[`tables parsing 1`] = `
"type": "tr",
},
{
- "attributes": {},
+ "attributes": {
+ "style": "text-align:left",
+ },
"id": "B00000003",
"parents": [
"table",
@@ -164,7 +414,9 @@ exports[`tables parsing 1`] = `
"type": "th",
},
{
- "attributes": {},
+ "attributes": {
+ "style": "text-align:right",
+ },
"id": "B00000004",
"parents": [
"table",
@@ -177,6 +429,30 @@ exports[`tables parsing 1`] = `
{
"attributes": {},
"id": "B00000005",
+ "parents": [
+ "table",
+ "thead",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "th",
+ },
+ {
+ "attributes": {
+ "style": "text-align:center",
+ },
+ "id": "B00000006",
+ "parents": [
+ "table",
+ "thead",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "th",
+ },
+ {
+ "attributes": {},
+ "id": "B00000007",
"parents": [
"table",
],
@@ -185,7 +461,7 @@ exports[`tables parsing 1`] = `
},
{
"attributes": {},
- "id": "B00000006",
+ "id": "B00000008",
"parents": [
"table",
"tbody",
@@ -193,9 +469,48 @@ exports[`tables parsing 1`] = `
"selfClosing": false,
"type": "tr",
},
+ {
+ "attributes": {
+ "style": "text-align:left",
+ },
+ "id": "B00000009",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {
+ "style": "text-align:right",
+ },
+ "id": "B0000000a",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
{
"attributes": {},
- "id": "B00000007",
+ "id": "B0000000b",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {
+ "style": "text-align:center",
+ },
+ "id": "B0000000c",
"parents": [
"table",
"tbody",
@@ -206,7 +521,32 @@ exports[`tables parsing 1`] = `
},
{
"attributes": {},
- "id": "B00000008",
+ "id": "B0000000d",
+ "parents": [
+ "table",
+ "tbody",
+ ],
+ "selfClosing": false,
+ "type": "tr",
+ },
+ {
+ "attributes": {
+ "style": "text-align:left",
+ },
+ "id": "B0000000e",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {
+ "style": "text-align:right",
+ },
+ "id": "B0000000f",
"parents": [
"table",
"tbody",
@@ -217,7 +557,31 @@ exports[`tables parsing 1`] = `
},
{
"attributes": {},
- "id": "B00000009",
+ "id": "B00000010",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {
+ "style": "text-align:center",
+ },
+ "id": "B00000011",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {},
+ "id": "B00000012",
"parents": [
"table",
"tbody",
@@ -225,9 +589,48 @@ exports[`tables parsing 1`] = `
"selfClosing": false,
"type": "tr",
},
+ {
+ "attributes": {
+ "style": "text-align:left",
+ },
+ "id": "B00000013",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {
+ "style": "text-align:right",
+ },
+ "id": "B00000014",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
{
"attributes": {},
- "id": "B0000000a",
+ "id": "B00000015",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {
+ "style": "text-align:center",
+ },
+ "id": "B00000016",
"parents": [
"table",
"tbody",
@@ -238,7 +641,56 @@ exports[`tables parsing 1`] = `
},
{
"attributes": {},
- "id": "B0000000b",
+ "id": "B00000017",
+ "parents": [
+ "table",
+ "tbody",
+ ],
+ "selfClosing": false,
+ "type": "tr",
+ },
+ {
+ "attributes": {
+ "style": "text-align:left",
+ },
+ "id": "B00000018",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {
+ "style": "text-align:right",
+ },
+ "id": "B00000019",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {},
+ "id": "B0000001a",
+ "parents": [
+ "table",
+ "tbody",
+ "tr",
+ ],
+ "selfClosing": false,
+ "type": "td",
+ },
+ {
+ "attributes": {
+ "style": "text-align:center",
+ },
+ "id": "B0000001b",
"parents": [
"table",
"tbody",
@@ -248,7 +700,40 @@ exports[`tables parsing 1`] = `
"type": "td",
},
],
- "marks": [],
- "text": "nameagelaios20marcille500",
+ "marks": [
+ {
+ "attributes": {},
+ "id": "M00000000",
+ "range": "(17..22]",
+ "type": "em",
+ },
+ {
+ "attributes": {
+ "href": "https://en.wikipedia.org/wiki/Delicious_in_Dungeon",
+ },
+ "id": "M00000001",
+ "range": "(17..22]",
+ "type": "link",
+ },
+ {
+ "attributes": {},
+ "id": "M00000002",
+ "range": "(75..88]",
+ "type": "em",
+ },
+ {
+ "attributes": {},
+ "id": "M00000003",
+ "range": "(82..88]",
+ "type": "strong",
+ },
+ {
+ "attributes": {},
+ "id": "M00000004",
+ "range": "(266..271]",
+ "type": "em",
+ },
+ ],
+ "text": "nameagejobnoteslaios20fighterA strange but earnest person. He really really likes monstersmarcille500mageDifficult to get along with but very competent. Despite seeming strict and fussy, she is interested in forbidden magic...falin18healerShe seems nice, but is actually just a people pleaser. When push comes to shove she will look out for people she loves and disregard strangerschilchuk29thiefLooks like a child but is actually a divorced father of three. He is serious about his work and isn't interested in getting close with people",
}
`;
diff --git a/packages/@atjson/source-commonmark/test/extensions.test.ts b/packages/@atjson/source-commonmark/test/extensions.test.ts
index 8abe36387..ae9f9904c 100644
--- a/packages/@atjson/source-commonmark/test/extensions.test.ts
+++ b/packages/@atjson/source-commonmark/test/extensions.test.ts
@@ -87,10 +87,12 @@ describe("strikethrough", () => {
describe("tables", () => {
const tableExample = `
-| name | age |
-| -------- | --- |
-| laios | 20 |
-| marcille | 500 |
+| name | age | job | [*notes*](https://en.wikipedia.org/wiki/Delicious_in_Dungeon) |
+|:-------- | ---:| ------- |:------------------------------------------------------------------------------------------------------------------------------------------------:|
+| laios | 20 | fighter | A strange but earnest person. He *really __really__* likes monsters |
+| marcille | 500 | mage | Difficult to get along with but very competent. Despite seeming strict and fussy, she is interested in forbidden magic... |
+| falin | 18 | healer | She *seems* nice, but is actually just a people pleaser. When push comes to shove she will look out for people she loves and disregard strangers |
+| chilchuk | 29 | thief | Looks like a child but is actually a divorced father of three. He is serious about his work and isn't interested in getting close with people |
`;
test("parsing", () => {
expect(