Created
December 14, 2011 20:55
-
-
Save lukec/1478478 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Check/View/Helpers.pm b/lib/Check/View/Helpers.pm | |
index 3fb000e..d9d2583 100644 | |
--- a/lib/Check/View/Helpers.pm | |
+++ b/lib/Check/View/Helpers.pm | |
@@ -171,6 +171,7 @@ sub format_text { | |
# If Markdown doesn't get to them first, the scrubber | |
# will pick them up and re-encode them as > | |
$text =~ s/>/>/g; | |
+ $text =~ s/`([^`]+)`/my $c = $1; $c =~ s{<}{<}; "`$c`"/egsm; | |
# Restore & because markdown force corrects it: | |
$text =~ s/&/&/g; | |
diff --git a/t/format-user-entered-text.t b/t/format-user-entered-text.t | |
index 33a455a..268f35d 100644 | |
--- a/t/format-user-entered-text.t | |
+++ b/t/format-user-entered-text.t | |
@@ -27,8 +27,9 @@ Named_links: { | |
"named link"); | |
} | |
-Backticked_Expressions_with_Links: { | |
+Backticks: { | |
text_ok("`Do a thing about https://skitch.com/obra`", '<code>Do a thing about <a href="https://skitch.com/obra" target="_blank">https://skitch.com/obra</a></code>'); | |
+ text_ok("Run: `cowsay <name>`", 'Run: <code>cowsay <name></code>'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment