Skip to content

Ignore links inside <script> tags #148

Closed

Description

@WhyNotHugo

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>

Activity

  1. untitaker commented on May 5, 2022

    @untitaker
    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

  2. untitaker commented on Jun 18, 2022

    @untitaker
    Owner

    underlying html5gum issue: untitaker/html5gum#11

  3. untitaker commented on Jun 18, 2022

    @untitaker
    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.

  4. untitaker commented on Oct 29, 2024

    @untitaker
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions