diff options
Diffstat (limited to 'packages/gitbook-core')
-rw-r--r-- | packages/gitbook-core/package.json | 1 | ||||
-rw-r--r-- | packages/gitbook-core/src/components/HTMLContent.js | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/packages/gitbook-core/package.json b/packages/gitbook-core/package.json index c6cfeed..4e3974e 100644 --- a/packages/gitbook-core/package.json +++ b/packages/gitbook-core/package.json @@ -6,6 +6,7 @@ "dependencies": { "bluebird": "^3.4.6", "classnames": "^2.2.5", + "entities": "^1.1.1", "history": "^4.3.0", "html-tags": "^1.1.1", "immutable": "^3.8.1", 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) }; }, |