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

fix: move h1 tags to template #6654

Merged
merged 2 commits into from
Apr 21, 2022
Merged

fix: move h1 tags to template #6654

merged 2 commits into from
Apr 21, 2022

Conversation

stephanegigandet
Copy link
Contributor

@stephanegigandet stephanegigandet commented Apr 20, 2022

Small changes to put the generation of <h1> title tags for all pages in templates.

@stephanegigandet stephanegigandet requested a review from a team as a code owner April 20, 2022 13:22
@github-actions github-actions bot added Display Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. labels Apr 20, 2022
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but a small improvement.

@@ -1434,10 +1433,10 @@ sub display_text($)
# wikipedia style links [url text]
$html =~ s/\[(http\S*?) ([^\]]+)\]/<a href="$1">$2<\/a>/g;


# Remove the title from the content to put it in the title field
if ($html =~ /<h1>(.*)<\/h1>/) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a non greedy expression (use ?) to handle case of multiple h1

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@stephanegigandet stephanegigandet merged commit b3b482b into main Apr 21, 2022
@stephanegigandet stephanegigandet deleted the h1 branch April 21, 2022 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Display Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes.
Projects
Development

Successfully merging this pull request may close these issues.

2 participants