Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

HTML rendering in the head title tag. #811

Open
ispykenny opened this issue Jul 24, 2020 · 5 comments
Open

HTML rendering in the head title tag. #811

ispykenny opened this issue Jul 24, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@ispykenny
Copy link

ispykenny commented Jul 24, 2020

Description
html markup showing up in head title tag.

To Reproduce

This is a title <br> that wraps two lines.

Expected behavior

<title> This is a title that wraps two lines. </title>

Actual behavior

<title> This is a title <br> that wraps two lines. </title>
  • what's the output you are seeing?
  • are there error messages?

Version:
run: $ hlx --version

Additional context
Add any other context about the problem here.

@ispykenny ispykenny added the bug Something isn't working label Jul 24, 2020
@tripodsan
Copy link
Contributor

@ispykenny how did you get the HTML into the title? i.e. where is the source for the title? is the <br> actual HTML in the title markup, or escaped?

@ispykenny
Copy link
Author

@tripodsan if i'm not mistaking the first line (or in my case H1) of a google doc becomes the page's <title> data. If your headline has a line-break in it (i.e shift + enter) it will create a
on the page (which is expected). However, this
tag also renders in the title tag as a string (which is not expected).

@tripodsan
Copy link
Contributor

so the HTML looks like <title> This is a title &lt;br&gt; that wraps two lines. </title> I guess...

@trieloff
Copy link
Contributor

Do you have an example URL for the problem? This may be a pipeline issue or a helix-pages issue or a gdocs2md issue.

@tripodsan
Copy link
Contributor

I think it's this:

function title(section) {
const header = select('heading', section);
section.title = header ? plain(header) : '';
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants