ckeditor / github-writer

GitHub Writer - WYSIWYG Rich-Text Editor for GitHub, powered by CKEditor.
https://ckeditor.com/
Other
380 stars 61 forks source link

Add handling of the image caption/resize #319

Open mateuszzagorski opened 2 years ago

mateuszzagorski commented 2 years ago

It would be nice to allow for using the image-caption and image-resize with GitHub Writer. Unfortunately, the Github Flavor Markdown syntax does not support caption/resizing image syntax out of the box, so it would require some additional work to convert the output into (for example) the valid html, or explore other possible solutions.
 

Possible solutions for the image-caption and/or image-resize:

Additional notes:

More regarding the Github markdown syntax can be found in the GitHub markdown documentation.


If you'd like to see this improvement implemented, add a :+1: reaction to this post.

mlewand commented 2 years ago
  • Target captions with css

I think we can't do this since we can't influence how CSS looks for non-GH writer users (messing with styling outside of editor within GH writer is also no-go).

That would be my go-to option, but is it possible to pass image caption as raw HTML on GitHub? I just checked it with markup generated by our editor.

<figure class="image image-style-side image_resized" style="width:17.33%;">
    <img src="https://ckeditor.com/docs/ckeditor5/latest/assets/img/game_boy.jpg">
    <figcaption>
        The Nintendo "flagship" - handheld Game Boy
    </figcaption>
</figure>

This goes below:

The Nintendo "flagship" - handheld Game Boy

And I can see that the figure and figurecaption elements got stripped. So I'm not sure if that's possible.

mlewand commented 2 years ago

I added a dedicated feature request for image resize #355 - let's keep the discussion separate as implementation is slightly different and both features can be added independently.