diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e21b07d..7a667b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,10 @@ jobs: with: ruby-version: '2.5' + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install bundler run: gem install bundler @@ -51,3 +55,19 @@ jobs: bundle exec jekyll --version bundle exec jekyll build python tests.py + + on_complete: + name: Notify IRC on Completion + runs-on: ubuntu-latest + needs: tests + if: always() + + steps: + - name: Send IRC notification + uses: allejo/supybot-notification-action@v1 + with: + status: ${{ needs.tests.result }} + hostname: ${{ secrets.SUPYBOT_HOSTNAME }} + credentials: ${{ secrets.SUPYBOT_PASSWORD }} + channel: '#sujevo-dev' + default_message: true diff --git a/_includes/anchor_headings.html b/_includes/anchor_headings.html index 69a5328..be83180 100644 --- a/_includes/anchor_headings.html +++ b/_includes/anchor_headings.html @@ -24,7 +24,7 @@ OTHER DEALINGS IN THE SOFTWARE. {% endcomment %} {% comment %} - Version 1.0.8 + Version 1.0.9 https://github.com/allejo/jekyll-anchor-headings "Be the pull request you wish to see in the world." ~Ben Balter @@ -97,8 +97,10 @@ {% capture anchor %}{% endcapture %} {% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %} + {% assign escaped_header = header | strip_html %} + {% if include.headerAttrs %} - {% capture _hAttrToStrip %}{{ _hAttrToStrip | split: '>' | first }} {{ include.headerAttrs | replace: '%heading%', header | replace: '%html_id%', html_id }}>{% endcapture %} + {% capture _hAttrToStrip %}{{ _hAttrToStrip | split: '>' | first }} {{ include.headerAttrs | replace: '%heading%', escaped_header | replace: '%html_id%', html_id }}>{% endcapture %} {% endif %} {% capture anchor %}href="#{{ html_id }}"{% endcapture %} @@ -108,14 +110,14 @@ {% endif %} {% if include.anchorTitle %} - {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', header }}"{% endcapture %} + {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', escaped_header }}"{% endcapture %} {% endif %} {% if include.anchorAttrs %} - {% capture anchor %}{{ anchor }} {{ include.anchorAttrs | replace: '%heading%', header | replace: '%html_id%', html_id }}{% endcapture %} + {% capture anchor %}{{ anchor }} {{ include.anchorAttrs | replace: '%heading%', escaped_header | replace: '%html_id%', html_id }}{% endcapture %} {% endif %} - {% capture anchor %}{{ include.anchorBody | replace: '%heading%', header | default: '' }}{% endcapture %} + {% capture anchor %}{{ include.anchorBody | replace: '%heading%', escaped_header | default: '' }}{% endcapture %} {% if beforeHeading %} diff --git a/_tests/escapeHeadingPlaceholder.html b/_tests/escapeHeadingPlaceholder.html new file mode 100644 index 0000000..b49b913 --- /dev/null +++ b/_tests/escapeHeadingPlaceholder.html @@ -0,0 +1,25 @@ +--- +# https://github.com/allejo/jekyll-anchor-headings/issues/27 +--- + +{% capture markdown %} +### The [**match**](#match) Expression +{% endcapture %} +{% assign text = markdown | markdownify %} + +{% include anchor_headings.html + beforeHeading=false + h_min=2 + html=text + anchorClass="permalink icon-link" + anchorBody="" + anchorTitle="Permalink for '%heading%'" + anchorAttrs='data-heading="%heading%"' + headerAttrs='data-heading="%heading%"' +%} + + + +