Elminiate excessive line breaks in <link> output

Created on 6 July 2023, over 1 year ago
Updated 13 May 2024, 7 months ago

Problem/Motivation

The output code breaks coding standards as it adds multiple line breaks to output, that should be within a single line.


<link rel="preload" href="/themes/custom/THEME/fonts/roboto-condensed/webfonts/roboto-condensed-v25-latin-300.woff2
" as="font" type="font/woff2
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/roboto-condensed/webfonts/roboto-condensed-v25-latin-300.ttf
" as="font" type="font/ttf
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/roboto-condensed/webfonts/roboto-condensed-v25-latin-300italic.woff2
" as="font" type="font/woff2
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/roboto-condensed/webfonts/roboto-condensed-v25-latin-300italic.ttf
" as="font" type="font/ttf
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/roboto-condensed/webfonts/roboto-condensed-v25-latin-regular.woff2
" as="font" type="font/woff2
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/roboto-condensed/webfonts/roboto-condensed-v25-latin-regular.ttf
" as="font" type="font/ttf
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/roboto-condensed/webfonts/roboto-condensed-v25-latin-700.woff2
" as="font" type="font/woff2
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/roboto-condensed/webfonts/roboto-condensed-v25-latin-700.ttf
" as="font" type="font/ttf
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/open-sans/webfonts/open-sans-v35-latin-300.woff2
" as="font" type="font/woff2
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/open-sans/webfonts/open-sans-v35-latin-300.ttf
" as="font" type="font/ttf
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/open-sans/webfonts/open-sans-v35-latin-300italic.woff2
" as="font" type="font/woff2
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/open-sans/webfonts/open-sans-v35-latin-300italic.ttf
" as="font" type="font/ttf
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/open-sans/webfonts/open-sans-v35-latin-regular.woff2
" as="font" type="font/woff2
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/open-sans/webfonts/open-sans-v35-latin-regular.ttf
" as="font" type="font/ttf
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/open-sans/webfonts/open-sans-v35-latin-700.woff2
" as="font" type="font/woff2
" crossorigin="">
<link rel="preload" href="/themes/custom/THEME/fonts/open-sans/webfonts/open-sans-v35-latin-700.ttf" as="font" type="font/ttf" crossorigin="">

Steps to reproduce

NOTE: if you "view source", it'll look properly formatted, however, it's not... Inspect the code in devtools and you'll see the line breaks. Also if you copy/paste the "view source" output, into a text file, you'll see the line breaks.

Proposed resolution

Only have a SINGLE line break after each <link> .

🐛 Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇺🇸United States duntuk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @duntuk
  • 🇺🇸United States rpearl

    I created a temporary patch that trims the font_path values for local file references: trim_EOLs.patch. This allowed me to not mess with any other code and just get it working for the time being, but this module will need some refactoring on how it handles the config values and there will need to be removal of the php80 references to make this fully working and compatible with D10.

  • Status changed to Closed: won't fix 7 months ago
  • 🇮🇳India Jaykumar95 Ahmedabad

    Thank you for the patch. It is fixed in new version.

Production build 0.71.5 2024