Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The title of the generated document is inconsistent with the original title #3798

Closed
1 task done
xfq opened this issue Oct 1, 2021 · 5 comments · Fixed by #3807
Closed
1 task done

The title of the generated document is inconsistent with the original title #3798

xfq opened this issue Oct 1, 2021 · 5 comments · Fixed by #3807
Labels

Comments

@xfq
Copy link
Contributor

xfq commented Oct 1, 2021

Important info

Description of problem

What happened (e.g., it crashed)?:

The title of the static HTML document generated by ReSpec is not the same as the original title of the document.

The title of https://w3c.github.io/clreq/ is "Requirements for Chinese Text Layout - 中文排版需求", but in the generated HTML it is "Requirements for Chinese Text Layout中文排版需求", and Pubrules reports an error:

Content of title and h1 do not match. Text of title is 'Requirements for Chinese Text Layout中文排版需求' while h1 is (transformed into) 'Requirements for Chinese Text Layout - 中文排版需求'.

Expected behavior (e.g., it shouldn't crash):

ReSpec should probably not modify the title of the document.

Optional, steps to reproduce:

  1. Open https://w3c.github.io/clreq/
  2. Generate a static HTML document
  3. Open the document and view the title of the document
@xfq xfq added the bug label Oct 1, 2021
@xfq
Copy link
Contributor Author

xfq commented Oct 4, 2021

I took a look at the cause of the problem, and it seems to be because ReSpec and Specberus have handled the h1/title of the document inconsistently:

@marcoscaceres
Copy link
Contributor

Hmm... I see, but the <br> handling seems very arbitrary in Specberus. We could do the same thing in ReSpec, but seems very fragile. If that's convention and we can't fix it some other way, we can do it.

@xfq
Copy link
Contributor Author

xfq commented Oct 5, 2021

Hmm... I see, but the <br> handling seems very arbitrary in Specberus. We could do the same thing in ReSpec, but seems very fragile. If that's convention and we can't fix it some other way, we can do it.

I'm not sure if there is a convention or a better way to fix it. Maybe @deniak knows more.

@deniak
Copy link
Contributor

deniak commented Oct 5, 2021

From https://www.w3.org/pubrules/doc/rules/?profile=WD#title, pubrules transforms:

  • :<br> with :
  • <br> with -

So for that specific document, pubrules expects the title to be "Requirements for Chinese Text Layout - 中文排版需求"

@marcoscaceres
Copy link
Contributor

I sent a PR that mirrors pubrules.

Just thinking out loud: an alternative way might have been to use CSS to hide ”:” and add a line break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants