docs: set unsafe HTML parsing to false and fix raw HTML insertion
This means that markdown files can't contain <thing> any more.
This commit is contained in:
parent
06427371eb
commit
74b8cbfb84
128 changed files with 945 additions and 645 deletions
|
@ -111,15 +111,21 @@ def read_doc(doc):
|
|||
contents = parts[2].strip()+"\n\n"
|
||||
# Remove icons
|
||||
contents = re.sub(r'<i class="fa.*?</i>\s*', "", contents)
|
||||
# Interpret img shortcodes
|
||||
# {{< img ... >}}
|
||||
contents = re.sub(r'\{\{<\s*img\s+(.*?)>\}\}', r"<img \1>", contents)
|
||||
# Make any img tags absolute
|
||||
contents = re.sub(r'(<img.*?src=")/', r"\1https://rclone.org/", contents)
|
||||
# Make [...](/links/) absolute
|
||||
contents = re.sub(r'\]\((\/.*?\/(#.*)?)\)', r"](https://rclone.org\1)", contents)
|
||||
# Add additional links on the front page
|
||||
contents = re.sub(r'<!--MAINPAGELINK-->', "- [Donate.](https://rclone.org/donate/)", contents)
|
||||
contents = re.sub(r'\{\{< rem MAINPAGELINK >\}\}', "- [Donate.](https://rclone.org/donate/)", contents)
|
||||
# Interpret provider shortcode
|
||||
# {{< provider name="Amazon S3" home="https://aws.amazon.com/s3/" config="/s3/" >}}
|
||||
contents = re.sub(r'\{\{<\s+provider.*?name="(.*?)".*?>\}\}', r"- \1", contents)
|
||||
contents = re.sub(r'\{\{<\s*provider.*?name="(.*?)".*?>\}\}', r"- \1", contents)
|
||||
# Remove remaining shortcodes
|
||||
contents = re.sub(r'\{\{<.*?>\}\}', r"", contents)
|
||||
contents = re.sub(r'\{\{%.*?%\}\}', r"", contents)
|
||||
return contents
|
||||
|
||||
def check_docs(docpath):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue