@tryghost/kg-mobiledoc-html-renderer 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,12 +98,25 @@ class MobiledocHtmlRenderer {
98
98
 
99
99
  render(mobiledoc, _cardOptions = {}) {
100
100
  const ghostVersion = mobiledoc.ghostVersion || '4.0';
101
+
101
102
  const defaultCardOptions = {
102
103
  ghostVersion,
103
104
  target: 'html'
104
105
  };
105
106
  const cardOptions = Object.assign({}, defaultCardOptions, _cardOptions);
106
- const rendererOptions = Object.assign({}, this.options, {cardOptions});
107
+
108
+ const sectionElementRenderer = {
109
+ ASIDE: function (tagName, dom) {
110
+ // we use ASIDE sections in Koenig as a workaround for applying
111
+ // a different blockquote style because mobiledoc doesn't support
112
+ // storing arbitrary attributes with sections
113
+ const blockquote = dom.createElement('blockquote');
114
+ blockquote.setAttribute('class', 'kg-blockquote-alt kg-width-wide');
115
+ return blockquote;
116
+ }
117
+ };
118
+
119
+ const rendererOptions = Object.assign({}, this.options, {cardOptions, sectionElementRenderer});
107
120
  const renderer = new Renderer(rendererOptions);
108
121
  const rendered = renderer.render(mobiledoc);
109
122
  const serializer = new SimpleDom.HTMLSerializer(SimpleDom.voidMap);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/kg-mobiledoc-html-renderer",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "repository": "https://github.com/TryGhost/Koenig/tree/master/packages/kg-mobiledoc-html-renderer",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -29,5 +29,5 @@
29
29
  "devDependencies": {
30
30
  "c8": "7.10.0"
31
31
  },
32
- "gitHead": "5fbc876127879babe588a577bc810038c98df5ef"
32
+ "gitHead": "050de1323b4051a0424a69b6aba0c790f6e38aeb"
33
33
  }