From 0c131024326a07da87e7cb5c0a5a7e6f42d95a33 Mon Sep 17 00:00:00 2001 From: h00die Date: Wed, 22 Jan 2020 21:08:32 -0500 Subject: [PATCH] long lines ok in code blocks --- tools/dev/msftidy_docs.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/dev/msftidy_docs.rb b/tools/dev/msftidy_docs.rb index 9f29798702..d1f59965ec 100644 --- a/tools/dev/msftidy_docs.rb +++ b/tools/dev/msftidy_docs.rb @@ -199,9 +199,15 @@ class MsftidyDoc def line_checks idx = 0 + in_codeblock = false + @lines.each do |ln| idx += 1 + if ln.scan(/```/).length.odd? + in_codeblock = !in_codeblock + end + if ln =~ /[ \t]$/ warn("Spaces at EOL", idx) end @@ -211,7 +217,7 @@ class MsftidyDoc end l = 140 - if ln.length > l + if ln.length > l && !in_codeblock warn("Line too long (#{ln.length}). Consider a newline (which resolves to a space in markdown) to break it up around #{l} characters.", idx) end