summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gitbook-core/src')
-rw-r--r--packages/gitbook-core/src/components/HTMLContent.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/gitbook-core/src/components/HTMLContent.js b/packages/gitbook-core/src/components/HTMLContent.js
index 4ce41f6..338e745 100644
--- a/packages/gitbook-core/src/components/HTMLContent.js
+++ b/packages/gitbook-core/src/components/HTMLContent.js
@@ -1,6 +1,7 @@
const React = require('react');
const ReactSafeHtml = require('react-safe-html');
const htmlTags = require('html-tags');
+const entities = require('entities');
const { InjectedComponent } = require('./InjectedComponent');
@@ -27,11 +28,12 @@ function inject(injectedProps, Component) {
}
const COMPONENTS = {
- // Templating blocks are exported as <template-block block="youtube" props="{}" />
- 'template-block': inject(
- ({block, props}) => {
+ // Templating blocks are exported as <xblock name="youtube" props="{}" />
+ 'xblock': inject(
+ ({name, props}) => {
+ props = entities.decodeHTML(props);
return {
- matching: { role: `block:${block}` },
+ matching: { role: `block:${name}` },
props: JSON.parse(props)
};
},