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

Ignore links inside <script> tags #148

Closed
WhyNotHugo opened this issue May 5, 2022 · 4 comments
Closed

Ignore links inside <script> tags #148

WhyNotHugo opened this issue May 5, 2022 · 4 comments

Comments

@WhyNotHugo
Copy link

The script in here should be ignored; it's not actual HTML.

<script id="algolia__template" type="text/template">
{% raw %}
  <div class="algolia__result">
    <a class="algolia__result-link" href="{{ full_url }}#algolia:{{ css_selector }}">{{{ _highlightResult.title.value }}}</a>
    {{#posted_at}}
    <div class="algolia__result-date">{{ posted_at_readable }}</div>
    {{/posted_at}}
    <div class="algolia__result-text">{{{ _highlightResult.text.value }}}</div>
  </div>
{% endraw %}
</script>
@untitaker
Copy link
Owner

Yeah unfortunately this is a known issue. It's a lack of features in the underlying html parsing library, specifically absence of a proper tree builder

@untitaker
Copy link
Owner

underlying html5gum issue: untitaker/html5gum#11

@untitaker
Copy link
Owner

Should be fixed in 0.1.22. There is still no proper tree builder in html5gum, but the library now includes workarounds that work in the majority of cases. Certainly good enough for hyperlink.

@untitaker
Copy link
Owner

There was a bug potentially affecting this, and causing link tags in <script> still to be read. It was fixed with #181, which will appear in 0.1.41

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

No branches or pull requests

2 participants