• My mammoth-options.js file is:

    function MAMMOTH_OPTIONS(mammoth) {
        var styleMap = [
            "p[style-name='blockquote'] => blockquote > p:fresh",
        ];
    
        function setParagraphStyleNameFromFonts(fonts, styleName, skipStyleNameRegex) {
            return mammoth.transforms.paragraph(function(paragraph) {
                var runs = mammoth.transforms.getDescendantsOfType(paragraph, "run");
                var isMatch = runs.length > 0 && runs.every(function(run) {
                    return run.font && fonts.indexOf(run.font.toLowerCase()) !== -1;
                });
                if (isMatch && !skipStyleNameRegex.test(paragraph.styleName)) {
                    return {...paragraph, styleName: styleName};
                } else {
                    return paragraph;
                }
            });
        }
    
        return {
            styleMap: styleMap,
            // If a paragraph is entirely made up of runs that use monospace fonts,
            // update the paragraph to use the style "Code Block" if it doesn't
            // already have a "Code Block" style.
            transformDocument: setParagraphStyleNameFromFonts(
                ["consolas", "courier", "courier new"],
                "Code Block",
                /^Code Block/i
            )
        };
    }
    

    I’ve created a docx file containing a paragraph with the style ‘blockquote’, however in the resulting wordpress post the paragraph is is not surrounded by blockquote tags. Where do I begin to look for the problem?

Viewing 1 replies (of 1 total)
  • Plugin Author Michael Williamson

    (@michaelwilliamson)

    I’d check whether there are any messages being outputted by Mammoth, in particular messages about unrecognised style names. I’d also check whether the preview HTML has any blockquotes, rather than the post itself.

Viewing 1 replies (of 1 total)

The topic ‘style ‘blockquote’ not recognized’ is closed to new replies.