Skip to content

Using an <iframe> inside a <table> breaks the pages HTML #725

@BryceRussell

Description

@BryceRussell

What version of astro are you using?

2.0.9

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Windows

Describe the Bug

If an <iframe> is placed inside a <table> then the HTML breaks on the page, for example

<table border='1'>
    <tr>
        <th>TH element</th>
        <td>TD element</td>
    </tr>
    <tr>
        <th>TH element</th>
        <td>
            <iframe src='https://docs.astro.build/en/getting-started/'></iframe>
        </td>
    </tr>
    <tr>
        <th>TH element</th>
        <td>TD element</td>
    </tr>
</table>

Build Output:

<table border="1">
            <tr>
                <th>TH element</th>
                <td>TD element</td>
            </tr>
            <tr>
                <th>TH element</th>
                <td>
                    <iframe src="https://docs.astro.build/en/getting-started/"></iframe>
                </td>
            </tr>
			
                TH element
                TD element
            
        
        
        </table>

I thought this might have something to do with not having a <tbody> so I added that to the example but then the build never progressed farther than [build] Building static entrypoints...

Open the /dist/index.html file in the minimal reproduction to get a better look at the broken HTML and try the frozen build command

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-jiw7an-sfczaf?file=src/pages/index.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions