diff --git a/Aptfile b/Aptfile index 5b75cbb4f4..e52c7db358 100644 --- a/Aptfile +++ b/Aptfile @@ -8,7 +8,6 @@ xsltproc # poppler-utils contains pdftoppm, which we use to import PDF graphics as web-friendy images -:repo:deb http://cz.archive.ubuntu.com/ubuntu bionic main universe poppler-utils # imagemagick is used to convert other images to web-friendly formats diff --git a/app.json b/app.json index 8d425c9321..7c077b0626 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,6 @@ { "addons": ["cloudamqp:lemur"], + "stack": "heroku-24", "buildpacks": [ { "url": "https://github.com/heroku/heroku-buildpack-apt.git" }, { "url": "heroku/nodejs" } diff --git a/client/components/Editor/schemas/audio.ts b/client/components/Editor/schemas/audio.ts index f5a1b800dd..f61cdcf161 100644 --- a/client/components/Editor/schemas/audio.ts +++ b/client/components/Editor/schemas/audio.ts @@ -36,6 +36,7 @@ export default { size: Number(node.getAttribute('data-size')) || 50, align: node.getAttribute('data-align') || 'center', caption: node.firstChild.getAttribute('alt') || '', + hideLabel: node.getAttribute('data-hide-label') || '', }; }, }, @@ -49,6 +50,7 @@ export default { 'data-node-type': 'audio', 'data-size': node.attrs.size, 'data-align': node.attrs.align, + 'data-hide-label': node.attrs.hideLabel, }, [ 'audio', diff --git a/client/components/Editor/schemas/code.ts b/client/components/Editor/schemas/code.ts index b3d86c5893..c51da34b5c 100644 --- a/client/components/Editor/schemas/code.ts +++ b/client/components/Editor/schemas/code.ts @@ -27,9 +27,17 @@ const renderStaticCode = (node: Node): DOMOutputSpec => { if (parser) { const tree = parser.parse(node.textContent); const children = fromLezer(node.textContent, tree as unknown as Tree); - return ['pre', ['code', ...children]] as DOMOutputSpec; + return [ + 'pre', + { id: node.attrs.id, 'data-lang': node.attrs.lang }, + ['code', ...children], + ] as DOMOutputSpec; } - return ['pre', ['code', node.textContent]] as DOMOutputSpec; + return [ + 'pre', + { id: node.attrs.id, ...(node.attrs.lang && { 'data-lang': node.attrs.lang }) }, + ['code', node.textContent], + ] as DOMOutputSpec; }; const codeSchema: { [key: string]: NodeSpec } = { diff --git a/client/components/Editor/schemas/iframe.ts b/client/components/Editor/schemas/iframe.ts index b55f9c8c92..95b1ccbf9e 100644 --- a/client/components/Editor/schemas/iframe.ts +++ b/client/components/Editor/schemas/iframe.ts @@ -38,6 +38,7 @@ export default { height: Number(node.firstChild.getAttribute('height')) || 419, align: node.getAttribute('data-align') || 'center', caption: node.firstChild.getAttribute('alt') || '', + hideLabel: node.getAttribute('data-hide-label') || '', }; }, }, @@ -51,6 +52,7 @@ export default { 'data-node-type': 'iframe', 'data-size': node.attrs.size, 'data-align': node.attrs.align, + 'data-hide-label': node.attrs.hideLabel, }, [ 'iframe', diff --git a/client/components/Editor/schemas/image.ts b/client/components/Editor/schemas/image.ts index dc2eeb10bb..e4354c64fd 100644 --- a/client/components/Editor/schemas/image.ts +++ b/client/components/Editor/schemas/image.ts @@ -58,13 +58,15 @@ export default { size: Number(node.getAttribute('data-size')) || 50, align: node.getAttribute('data-align') || 'center', altText: node.getAttribute('data-alt-text') || '', + hideLabel: node.getAttribute('data-hide-label') || '', href: node.getAttribute('data-href') || null, }; }, }, ], toDOM: (node, { isStaticallyRendered } = { isStaticallyRendered: false }) => { - const { url, align, id, altText, caption, fullResolution, size, href } = node.attrs; + const { url, align, id, altText, caption, fullResolution, size, hideLabel, href } = + node.attrs; const width = align === 'breakout' ? 1920 : 800; const isResizeable = isResizeableFormat(url) && !fullResolution; @@ -92,6 +94,7 @@ export default { 'data-caption': caption, 'data-href': href, 'data-alt-text': altText, + 'data-hide-label': hideLabel, }, href ? [ diff --git a/client/components/Editor/schemas/video.ts b/client/components/Editor/schemas/video.ts index ec2d43a9d5..982939c2f3 100644 --- a/client/components/Editor/schemas/video.ts +++ b/client/components/Editor/schemas/video.ts @@ -39,6 +39,7 @@ export default { align: node.getAttribute('data-align') || 'center', caption: node.firstChild.getAttribute('alt') || '', loop: !!node.firstChild.getAttribute('loop'), + hideLabel: node.getAttribute('data-hide-label') || '', }; }, }, @@ -52,6 +53,7 @@ export default { 'data-node-type': 'video', 'data-size': node.attrs.size, 'data-align': node.attrs.align, + 'data-hide-label': node.attrs.hideLabel, }, [ 'video', diff --git a/client/components/Editor/utils/renderStatic.ts b/client/components/Editor/utils/renderStatic.ts index 1759e6f02d..6662c747f7 100644 --- a/client/components/Editor/utils/renderStatic.ts +++ b/client/components/Editor/utils/renderStatic.ts @@ -105,7 +105,7 @@ const fillHoleInSpec = (outputSpec, children, isMark) => { }; const wrapOutputSpecInMarks = (outputSpec, marks, schema) => { - return marks.reduce((child, mark) => { + return [...marks].reverse().reduce((child, mark) => { const { spec: markSpec } = schema.marks[mark.type]; return fillHoleInSpec(markSpec.toDOM(mark), [child], true); }, outputSpec); diff --git a/client/components/Footer/Footer.tsx b/client/components/Footer/Footer.tsx index 08e2d4b18a..c56ece1d10 100644 --- a/client/components/Footer/Footer.tsx +++ b/client/components/Footer/Footer.tsx @@ -33,7 +33,6 @@ const defaultProps = { type Props = OwnProps & typeof defaultProps; const basePubPubFooterLinks = [ - { id: '1', title: 'Create your community', href: '/community/create' }, { id: '2', title: 'Login', href: '/login' }, { id: '3', title: 'Signup', href: '/signup' }, { id: '4', title: 'Legal', href: '/legal' }, @@ -143,21 +142,17 @@ const Footer = (props: Props) => {