Ckeditor5: Figure tags from Image plugin are not handled

Created on 27 Feb 2018  路  4Comments  路  Source: ckeditor/ckeditor5

src/lib/to-markdown/to-markdown.js does not seem to handle the figure tag inserted by the image plugin resulting in visible

tags in rendered markdown.
screen shot 2018-02-26 at 16 02 42


If you'd like to see this fixed sooner, add a 馃憤 reaction to this post.

markdown-gfm bug

Most helpful comment

It looks like to-markdown is missing a converter from figure. It should be implemented in: https://github.com/ckeditor/ckeditor5-markdown-gfm/blob/b29a5b2f8176637e9dcd02bc85f85a061afc3dab/src/lib/to-markdown/converters.js.

It should look something like this:

{
    filter: node => {
        return node.nodeName === 'FIGURE' && node.classList.contains( 'image' );
    },

    replacement: content => content
}

This will ignore figure tag and let regular img converter do its job.

All 4 comments

cc @szymonkups

It looks like to-markdown is missing a converter from figure. It should be implemented in: https://github.com/ckeditor/ckeditor5-markdown-gfm/blob/b29a5b2f8176637e9dcd02bc85f85a061afc3dab/src/lib/to-markdown/converters.js.

It should look something like this:

{
    filter: node => {
        return node.nodeName === 'FIGURE' && node.classList.contains( 'image' );
    },

    replacement: content => content
}

This will ignore figure tag and let regular img converter do its job.

Hi @mlewand, just wondering if there is any progress on this issue?

AFAICS this works with current master, so probably marked/turndown upgrade did the trick.

OTOH I'd say that similar issues would not have a big priority as the markdown plugin should be compatible with itself. In other words markdown -> editor -> markdown should be reliable.

Was this page helpful?
0 / 5 - 0 ratings