Add support for the <figure> element

Open
#47 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Start by reproducing the supplied

example in the editor and trace the existing handling for HTML elements. Confirm when and why the figure currently works only sometimes. Done means the example renders consistently, including its linked image and caption.

Written by the indexing model from the issue text.

Description

enhancement
<figure style="width: 80%; margin: auto;">
    <a href="https://en.wikipedia.org/wiki/File:World_Magnetic_Declination_2015.pdf">
      <img src="https://placekittens.com/200/300">
    </a>
    <figcaption style="text-align:center">A map of the magnetic declination on planet Earth</figcaption>
</figure>

should work. It currently turns into this:

<figure style="width: 80%; margin: auto;">

<a href="https://en.wikipedia.org/wiki/File:World_Magnetic_Declination_2015.pdf">

![](https://placekittens.com/200/300)

    

</a>

<figcaption style="text-align:center">A map of the magnetic declination on planet Earth</figcaption>

</figure>

which is a hot mess of nonsense, it should turn into:

<figure style="width: 80%; margin: auto;">

[![](https://placekittens.com/200/300)](https://en.wikipedia.org/wiki/File:World_Magnetic_Declination_2015.pdf)

    <figcaption style="text-align:center">A map of the magnetic declination on planet Earth</figcaption>
</figure>
Dominant language
JavaScript
Stars
1
Forks
1
Avg merge
9h 8m
Merged PRs (30d)
16

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Pomax/markdown-editor

All issues in Pomax/markdown-editor

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.