Skip to content

Commit

Permalink
exporters/markdown_multipage: URL encode links href in literal HTML…
Browse files Browse the repository at this point in the history
  • Loading branch information
nodiscc committed Oct 27, 2023
1 parent 453ccd6 commit fddad24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
- processors/awesome_lint: allow skipping last update checks for specific items by `source_code_url`

**Fixed:**
- exporters/markdown_multipage: URL encode links `href` in literal HTML blocks
- processors/awesome_lint: don't log last update date check errors twice

---------------------
Expand Down
5 changes: 3 additions & 2 deletions hecat/exporters/markdown_multipage.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import sys
import logging
from datetime import datetime, timedelta
import urllib
import ruamel.yaml
from jinja2 import Template
from ..utils import load_yaml_data, to_kebab_case, render_markdown_licenses
Expand Down Expand Up @@ -257,9 +258,9 @@ def render_markdown_software(software, tags_relative_url='tags/', platforms_rela
tags_dicts_list = []
platforms_dicts_list = []
for tag in software['tags']:
tags_dicts_list.append({"name": tag, "href": tags_relative_url + to_kebab_case(tag) + '.html'})
tags_dicts_list.append({"name": tag, "href": tags_relative_url + urllib.parse.quote(to_kebab_case(tag)) + '.html'})
for platform in software['platforms']:
platforms_dicts_list.append({"name": platform, "href": platforms_relative_url + to_kebab_case(platform) + '.html'})
platforms_dicts_list.append({"name": platform, "href": platforms_relative_url + urllib.parse.quote(to_kebab_case(platform)) + '.html'})
date_css_class = 'updated-at'
if 'updated_at' in software:
last_update_time = datetime.strptime(software['updated_at'], "%Y-%m-%d")
Expand Down

0 comments on commit fddad24

Please sign in to comment.