Masterminds / Masterminds/html5-php

Parser returns SVG with image-tag as text-node

Open
#211 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.8k
Forks
122
PR merge metrics
No merged PRs in 30d

Description

The current version 2.7.5 still returns svg as text node:

<ul id="nav1" class="nav1main">
    <li>
        <a href="/" class="logo-image">
            &lt;svg id="logo-mobile"&gt;
                &lt;image href="logo-mobile.svg" width="100%" height="100%" /&gt;
            &lt;/svg&gt;
        </a>
    </li>
</ul>

Source:

<ul id="nav1" class="nav1main">
    <li>
        <a href="/" class="logo-image">
            <svg id="logo-mobile">
                <image href="logo-mobile.svg" width="100%" height="100%"></image>
            </svg>
        </a>
    </li>
</ul>

Equal, if image with separate closing tag or self-closing.

Originally posted by @mat-hew1 in https://github.com/Masterminds/html5-php/issues/129#issuecomment-904601890

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the reported SVG and image-tag cases from the issue against the parser, comparing self-closing and separately closed image elements. Trace the parser path that converts the SVG content into a text node; done means both source forms produce equivalent SVG and image elements rather than escaped text.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.