From dafd900e93590c6a10c3e0ba9dedf9102e2934af Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 8 Nov 2016 18:19:05 -0800 Subject: docs/_plugins/bugify.rb: Add support for MS A11y UserVoice ideas Refs #21089 [ci skip] --- docs/_plugins/bugify.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/_plugins') diff --git a/docs/_plugins/bugify.rb b/docs/_plugins/bugify.rb index 5562dd5de..0d658a9fa 100644 --- a/docs/_plugins/bugify.rb +++ b/docs/_plugins/bugify.rb @@ -5,6 +5,7 @@ module Jekyll "Bootstrap" => "https://github.com/twbs/bootstrap/issues/", "Edge" => ["https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/", "Edge issue"], "UserVoice" => ["https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/", "Edge UserVoice idea"], + "A11yUserVoice" => ["https://microsoftaccessibility.uservoice.com/forums/307429-microsoft-accessibility-feedback/suggestions/", "Microsoft A11y UserVoice idea"], "Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"], "Chromium" => ["https://bugs.chromium.org/p/chromium/issues/detail?id=", "Chromium issue"], "WebKit" => ["https://bugs.webkit.org/show_bug.cgi?id=", "WebKit bug"], -- cgit v1.2.3 From e156d2bb727c9ab25504cac065c922c22c95c074 Mon Sep 17 00:00:00 2001 From: Bardi Harborow Date: Mon, 5 Dec 2016 11:45:50 +1100 Subject: Fix A11yUserVoice bugify rendering. (#21282) --- docs/_plugins/bugify.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/_plugins') diff --git a/docs/_plugins/bugify.rb b/docs/_plugins/bugify.rb index 0d658a9fa..0f910718b 100644 --- a/docs/_plugins/bugify.rb +++ b/docs/_plugins/bugify.rb @@ -4,8 +4,8 @@ module Jekyll upstream_map = { "Bootstrap" => "https://github.com/twbs/bootstrap/issues/", "Edge" => ["https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/", "Edge issue"], - "UserVoice" => ["https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/", "Edge UserVoice idea"], "A11yUserVoice" => ["https://microsoftaccessibility.uservoice.com/forums/307429-microsoft-accessibility-feedback/suggestions/", "Microsoft A11y UserVoice idea"], + "UserVoice" => ["https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/", "Edge UserVoice idea"], "Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"], "Chromium" => ["https://bugs.chromium.org/p/chromium/issues/detail?id=", "Chromium issue"], "WebKit" => ["https://bugs.webkit.org/show_bug.cgi?id=", "WebKit bug"], -- cgit v1.2.3 From e8ff150ab760b4a47bcfc3e2056a430e54e09c90 Mon Sep 17 00:00:00 2001 From: Starsam80 Date: Tue, 27 Dec 2016 15:15:22 -0700 Subject: Don't show `.bd-*` classes to the user (#21443) * Don't show `bd-*` classes to the user * Add comments and another regex --- docs/_plugins/highlight_alt.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'docs/_plugins') diff --git a/docs/_plugins/highlight_alt.rb b/docs/_plugins/highlight_alt.rb index bdcada251..8a86a2202 100644 --- a/docs/_plugins/highlight_alt.rb +++ b/docs/_plugins/highlight_alt.rb @@ -57,16 +57,26 @@ eos def example(output) "
\n#{output}\n
" end - + def remove_holderjs(code) code = code.gsub(/data-src="holder.js.+?"/, 'src="..."') end + def remove_example_classes(code) + # Find `bd-` classes and remove them from the highlighted code. Because of how this regex works, it will also + # remove classes that are after the `bd-` class. While this is a bug, I left it because it can be helpful too. + # To fix the bug, replace `(?=")` with `(?=("|\ ))`. + code = code.gsub(/(?!class=".)\ *?bd-.+?(?=")/, "") + # Find empty class attributes after the previous regex and remove those too. + code = code.gsub(/\ class=""/, "") + end + def render_rouge(code) require 'rouge' formatter = Rouge::Formatters::HTML.new(line_numbers: @options[:linenos], wrap: false) lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText code = remove_holderjs(code) + code = remove_example_classes(code) code = formatter.format(lexer.lex(code)) "
#{code}
" end -- cgit v1.2.3