Created
August 17, 2015 06:30
-
-
Save anonymous/ac0b788fac4e35f178be 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
From 9694ff5a8b5cb776a3e160e939f955fe9b0a7234 Mon Sep 17 00:00:00 2001 | |
From: Luca Bennati <labensigma@gmail.com> | |
Date: Sat, 15 Aug 2015 17:52:48 +0200 | |
Subject: [PATCH] fix split usage | |
--- | |
lib/Text/Markdown.pm | 3 ++- | |
1 file changed, 2 insertions(+), 1 deletion(-) | |
diff --git a/lib/Text/Markdown.pm b/lib/Text/Markdown.pm | |
index 3cc3c5b..6db83f0 100644 | |
--- a/lib/Text/Markdown.pm | |
+++ b/lib/Text/Markdown.pm | |
@@ -126,7 +126,8 @@ sub _UnescapeSpecialChars($text) { | |
sub extract_tspans($text) { | |
# XXX the below regex wouldn't work for e.g. <b><em><b>foo</b></em></b> | |
- gather for $text.split(/'<'(\w+)'>'.*?'</'$0'>'/, :all) -> $normal, $taggy? { | |
+ gather for $text.split(/'<'(\w+)'>'.*?'</'$0'>'/, :all) -> $piece { | |
+ my ($normal, $taggy) = $piece.list; | |
take TSpan.new(:text($normal)); | |
if $taggy { | |
# XXX highly specialized but works for our immediate purposes | |
-- | |
2.5.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment