reveal.js icon indicating copy to clipboard operation
reveal.js copied to clipboard

Whitespace in header breaks table

Open MartenBE opened this issue 1 year ago • 1 comments

Indentation of a header breaks how a table is interpreted. It is easiest explained using following example:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

        <title>reveal.js</title>

        <link rel="stylesheet" href="dist/reset.css" />
        <link rel="stylesheet" href="dist/reveal.css" />
        <link rel="stylesheet" href="dist/theme/black.css" />

        <!-- Theme used for syntax highlighted code -->
        <link rel="stylesheet" href="plugin/highlight/monokai.css" />
    </head>
    <body>
        <div class="reveal">
            <div class="slides">
                <section data-markdown>
                    <textarea data-template>
# Test 1

|                  | aze              | qsd              |
| ---------------- | ---------------- | ---------------- |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |

---

    # Test 2

|                  | aze              | qsd              |
| ---------------- | ---------------- | ---------------- |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |

---

        # Test 3

|                  | aze              | qsd              |
| ---------------- | ---------------- | ---------------- |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |

---

            # Test 4

|                  | aze              | qsd              |
| ---------------- | ---------------- | ---------------- |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |

---

                # Test 5

|                  | aze              | qsd              |
| ---------------- | ---------------- | ---------------- |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |

---

                    # Test 6

|                  | aze              | qsd              |
| ---------------- | ---------------- | ---------------- |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |

---

                        # Test 7

|                  | aze              | qsd              |
| ---------------- | ---------------- | ---------------- |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |
| 1234567890123456 | 1234567890123456 | 1234567890123456 |

                </textarea>
            </section>
        </div>

        <script src="dist/reveal.js"></script>
        <script src="plugin/notes/notes.js"></script>
        <script src="plugin/markdown/markdown.js"></script>
        <script src="plugin/highlight/highlight.js"></script>
        <script>
            // More info about initialization & config:
            // - https://revealjs.com/initialization/
            // - https://revealjs.com/config/
            Reveal.initialize({
                hash: true,

                // Learn about plugins: https://revealjs.com/plugins/
                plugins: [RevealMarkdown, RevealHighlight, RevealNotes],
            });
        </script>
    </body>
</html>

test-1 test-2 test-3 test-4 test-5 test-6 test-7

We also see this when introducing whitespace larger than 12 spaces using reveal-md which calls reveal.js to go from markup to markdown, so we suspect this is a reveal.js issue: https://github.com/webpro/reveal-md/issues/476

MartenBE avatar Aug 26 '24 12:08 MartenBE

Marked however shows no issues regarding the table: link to demo

MartenBE avatar Jan 04 '25 16:01 MartenBE