Skip to content

A free and open-source block-based email template builder.

Fixing markdown allowed attributes (#112)

cohitre512dd375e846
diff --git a/packages/block-text/package-lock.json b/packages/block-text/package-lock.json
index fac17c6..8e03601 100644
--- a/packages/block-text/package-lock.json
+++ b/packages/block-text/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@usewaypoint/block-text",
- "version": "0.0.5",
+ "version": "0.0.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@usewaypoint/block-text",
- "version": "0.0.5",
+ "version": "0.0.6",
"license": "MIT",
"dependencies": {
"insane": "^2.6.2",
diff --git a/packages/block-text/package.json b/packages/block-text/package.json
index f5ca587..a96d210 100644
--- a/packages/block-text/package.json
+++ b/packages/block-text/package.json
@@ -1,6 +1,6 @@
{
"name": "@usewaypoint/block-text",
- "version": "0.0.5",
+ "version": "0.0.6",
"description": "@usewaypoint/document compatible Text component",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
diff --git a/packages/block-text/src/EmailMarkdown.tsx b/packages/block-text/src/EmailMarkdown.tsx
index b390c89..ef7cafb 100644
--- a/packages/block-text/src/EmailMarkdown.tsx
+++ b/packages/block-text/src/EmailMarkdown.tsx
@@ -57,8 +57,11 @@ function sanitizer(html: string): string {
}, {}),
img: ['src', 'srcset', 'alt', 'width', 'height', ...GENERIC_ALLOWED_ATTRIBUTES],
table: ['width', ...GENERIC_ALLOWED_ATTRIBUTES],
- td: ['width', ...GENERIC_ALLOWED_ATTRIBUTES],
+ td: ['align', 'width', ...GENERIC_ALLOWED_ATTRIBUTES],
+ th: ['align', 'width', ...GENERIC_ALLOWED_ATTRIBUTES],
a: ['href', 'target', ...GENERIC_ALLOWED_ATTRIBUTES],
+ ol: ['start', ...GENERIC_ALLOWED_ATTRIBUTES],
+ ul: ['start', ...GENERIC_ALLOWED_ATTRIBUTES],
},
});
}
diff --git a/packages/editor-sample/package-lock.json b/packages/editor-sample/package-lock.json
index 4746627..b9f04d4 100644
--- a/packages/editor-sample/package-lock.json
+++ b/packages/editor-sample/package-lock.json
@@ -21,9 +21,9 @@
"@usewaypoint/block-html": "^0.0.3",
"@usewaypoint/block-image": "^0.0.5",
"@usewaypoint/block-spacer": "^0.0.3",
- "@usewaypoint/block-text": "^0.0.5",
+ "@usewaypoint/block-text": "^0.0.6",
"@usewaypoint/document-core": "^0.0.6",
- "@usewaypoint/email-builder": "^0.0.7",
+ "@usewaypoint/email-builder": "^0.0.8",
"highlight.js": "^11.9.0",
"prettier": "^3.2.5",
"react": "^18.2.0",
@@ -1959,9 +1959,9 @@
}
},
"node_modules/@usewaypoint/block-text": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@usewaypoint/block-text/-/block-text-0.0.5.tgz",
- "integrity": "sha512-b8xCDL3iruOfoxrvg4bMBcNgb9iQnU53Qp6VZskEA++L2Pz4tTWZ267ChPce7ocWhd7m17LpXrVdyC+6GvPHTw==",
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/@usewaypoint/block-text/-/block-text-0.0.6.tgz",
+ "integrity": "sha512-tsKTNLXUYs1PkM8G5sgIhO3KnW1IFTx2q+lnq5Y4prHeHNBrArez5BbwAyvwBKnhcIt5c4gYL2CSklIU4+hLLw==",
"dependencies": {
"insane": "^2.6.2",
"marked": "^12.0.2"
@@ -1981,9 +1981,9 @@
}
},
"node_modules/@usewaypoint/email-builder": {
- "version": "0.0.7",
- "resolved": "https://registry.npmjs.org/@usewaypoint/email-builder/-/email-builder-0.0.7.tgz",
- "integrity": "sha512-ANOLEz7mN+wsSQP06KQiVgYj398RLP/WmJ6+h0q8ZyXHZSHBCEnZRKg/42jwPAuvaDGQ5j/daMlhBdUxmZSe5Q==",
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/@usewaypoint/email-builder/-/email-builder-0.0.8.tgz",
+ "integrity": "sha512-gP1Us3n/rh9GoCnJRHN8INqYD9qPJ0wErm0SCjz6ng8IGSBBL+k0fFKD7l1mT3BflZSjCl6heqRDu9aRw1AcFw==",
"dependencies": {
"@usewaypoint/block-avatar": "^0.0.3",
"@usewaypoint/block-button": "^0.0.3",
@@ -1994,7 +1994,7 @@
"@usewaypoint/block-html": "^0.0.3",
"@usewaypoint/block-image": "^0.0.5",
"@usewaypoint/block-spacer": "^0.0.3",
- "@usewaypoint/block-text": "^0.0.5",
+ "@usewaypoint/block-text": "^0.0.6",
"@usewaypoint/document-core": "^0.0.6"
},
"peerDependencies": {
diff --git a/packages/editor-sample/package.json b/packages/editor-sample/package.json
index f57618f..a197149 100644
--- a/packages/editor-sample/package.json
+++ b/packages/editor-sample/package.json
@@ -21,9 +21,9 @@
"@usewaypoint/block-html": "^0.0.3",
"@usewaypoint/block-image": "^0.0.5",
"@usewaypoint/block-spacer": "^0.0.3",
- "@usewaypoint/block-text": "^0.0.5",
+ "@usewaypoint/block-text": "^0.0.6",
"@usewaypoint/document-core": "^0.0.6",
- "@usewaypoint/email-builder": "^0.0.7",
+ "@usewaypoint/email-builder": "^0.0.8",
"highlight.js": "^11.9.0",
"prettier": "^3.2.5",
"react": "^18.2.0",
diff --git a/packages/editor-sample/src/App/InspectorDrawer/ConfigurationPanel/input-panels/TextSidebarPanel.tsx b/packages/editor-sample/src/App/InspectorDrawer/ConfigurationPanel/input-panels/TextSidebarPanel.tsx
index ca61a04..3ef17fb 100644
--- a/packages/editor-sample/src/App/InspectorDrawer/ConfigurationPanel/input-panels/TextSidebarPanel.tsx
+++ b/packages/editor-sample/src/App/InspectorDrawer/ConfigurationPanel/input-panels/TextSidebarPanel.tsx
@@ -34,7 +34,7 @@ export default function TextSidebarPanel({ data, setData }: TextSidebarPanelProp
/>
<BooleanInput
label="Markdown"
- defaultValue={false}
+ defaultValue={data.props?.markdown ?? false}
onChange={(markdown) => updateData({ ...data, props: { ...data.props, markdown } })}
/>
diff --git a/packages/email-builder/package-lock.json b/packages/email-builder/package-lock.json
index f9d30b9..07846d7 100644
--- a/packages/email-builder/package-lock.json
+++ b/packages/email-builder/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@usewaypoint/email-builder",
- "version": "0.0.7",
+ "version": "0.0.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@usewaypoint/email-builder",
- "version": "0.0.7",
+ "version": "0.0.8",
"license": "MIT",
"dependencies": {
"@usewaypoint/block-avatar": "^0.0.3",
@@ -18,7 +18,7 @@
"@usewaypoint/block-html": "^0.0.3",
"@usewaypoint/block-image": "^0.0.5",
"@usewaypoint/block-spacer": "^0.0.3",
- "@usewaypoint/block-text": "^0.0.5",
+ "@usewaypoint/block-text": "^0.0.6",
"@usewaypoint/document-core": "^0.0.6"
},
"peerDependencies": {
@@ -109,9 +109,9 @@
}
},
"node_modules/@usewaypoint/block-text": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@usewaypoint/block-text/-/block-text-0.0.5.tgz",
- "integrity": "sha512-b8xCDL3iruOfoxrvg4bMBcNgb9iQnU53Qp6VZskEA++L2Pz4tTWZ267ChPce7ocWhd7m17LpXrVdyC+6GvPHTw==",
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/@usewaypoint/block-text/-/block-text-0.0.6.tgz",
+ "integrity": "sha512-tsKTNLXUYs1PkM8G5sgIhO3KnW1IFTx2q+lnq5Y4prHeHNBrArez5BbwAyvwBKnhcIt5c4gYL2CSklIU4+hLLw==",
"dependencies": {
"insane": "^2.6.2",
"marked": "^12.0.2"
diff --git a/packages/email-builder/package.json b/packages/email-builder/package.json
index 405e226..de53cc2 100644
--- a/packages/email-builder/package.json
+++ b/packages/email-builder/package.json
@@ -1,6 +1,6 @@
{
"name": "@usewaypoint/email-builder",
- "version": "0.0.7",
+ "version": "0.0.8",
"description": "React component to render email messages",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
@@ -35,7 +35,7 @@
"@usewaypoint/block-html": "^0.0.3",
"@usewaypoint/block-image": "^0.0.5",
"@usewaypoint/block-spacer": "^0.0.3",
- "@usewaypoint/block-text": "^0.0.5",
+ "@usewaypoint/block-text": "^0.0.6",
"@usewaypoint/document-core": "^0.0.6"
}
}