From b9628d064225eb703ea200fe170748c0942b3261 Mon Sep 17 00:00:00 2001 From: m5o Date: Mon, 12 Mar 2018 22:08:44 +0100 Subject: Use bugify without custom Jekyll plugin (#25334) --- _includes/bugify.html | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 _includes/bugify.html (limited to '_includes/bugify.html') diff --git a/_includes/bugify.html b/_includes/bugify.html new file mode 100644 index 000000000..6a02bd23e --- /dev/null +++ b/_includes/bugify.html @@ -0,0 +1,42 @@ +{%- comment -%} +Usage: {% include bugify.html content=text %}, +where content is a string that contains a bug reference name and id. +e.g. Bootstrap#19984 +{%- endcomment -%} + +{%- assign words = include.content | split: " " -%} + +{%- for word in words -%} + {% if word contains "#" %} + {% if word contains "," %}{% assign separator = true %}{% else %}{% assign separator = false %}{% endif %} + {%- assign data = word | split: "#" -%} + {%- assign bug_cat = data[0] | strip_newlines -%} + {%- assign bug_id = data[1] | strip_newlines | remove: "," -%} + + {%- case bug_cat -%} + {%- when "Bootstrap" -%} + #{{ bug_id }} + {%- when "Edge" -%} + Edge issue #{{ bug_id }} + {%- when "A11yUserVoice" -%} + Microsoft A11y UserVoice idea #{{ bug_id }} + {%- when "UserVoice" -%} + Edge UserVoice idea #{{ bug_id }} + {%- when "Mozilla" -%} + Mozilla bug #{{ bug_id }} + {%- when "Chromium" -%} + Chromium issue #{{ bug_id }} + {%- when "WebKit" -%} + WebKit bug #{{ bug_id }} + {%- when "Safari" -%} + Apple Safari Radar #{{ bug_id }} + {%- when "Normalize" -%} + Normalize #{{ bug_id }} + {%- else -%} + parse error + {%- endcase -%}{% if separator %}, {% endif %} + + {% else %} + {{ word }} + {%- endif -%} +{%- endfor -%} -- cgit v1.2.3