Skip to content

Duplicate custom font <link> tags generated in compiled HTML #40

Description

@TheoPierne

Hi !
When using a custom font (e.g. Poppins from Google Fonts), the compiled HTML output contains multiple identical <link href="https://fonts.googleapis.com/..." rel="stylesheet"> entries inside the <head>.

Example output :

<!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"><!--<![endif]-->
<!--[if mso]>
<xml>
    <w:WordDocument xmlns:w="urn:schemas-microsoft-com:office:word">
        <w:DontUseAdvancedTypographyReadingMail/>
    </w:WordDocument>
</xml><![endif]--><!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"><!--<![endif]-->
<!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"><!--<![endif]-->
<!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"><!--<![endif]-->
<!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"><!--<![endif]-->
<!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"><!--<![endif]-->

Expected behavior:

Only one unique Google Fonts link per URL should be generated.

Actual behavior:

Duplicate entries are inserted (sometimes 3-4 times).

This increases HTML size and requires post-processing to remove duplicates.


Stripo Plugin version: 1.184.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions