mkdocs / mkdocs

Project documentation with Markdown.
https://www.mkdocs.org
BSD 2-Clause "Simplified" License
18.49k stars 2.36k forks source link

Mkdocs strips <caption> tag from markdown files #3646

Closed fbuchinger closed 1 month ago

fbuchinger commented 1 month ago

Steps to reproduce

  1. In a new directory, create mkdocs.yml with the following content site_name: Mkdocs CaptionStrip

  2. In the same directory, create docs/index.md with following content

    # Caption Visibility Test
    <caption style="display:none">you should not see this - caption</caption>
    <cite style="display:none">you should not see this - cite</cite>
  3. In the directory, run mkdocs serve and open localhost:8000

Expected behaviour

Both captions are invisible (due to css styling)

Actual behaviour

Only second caption (cite tag) is invisible.

mkdocs version

1.5.2 /Python 3.10

Why is this an issue

I want to hide tags in a converted markdown file as the images for the caption are not available yet.

facelessuser commented 1 month ago

This has nothing to do with MkDocs, and everything to do with how a browser may handle the the tag as you are using it.

Screenshot 2024-04-16 at 6 27 29 AM

https://codepen.io/facelessuser/pen/rNbZGQZ