Skip to content

Instantly share code, notes, and snippets.

Created August 17, 2015 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ac0b788fac4e35f178be to your computer and use it in GitHub Desktop.
Save anonymous/ac0b788fac4e35f178be to your computer and use it in GitHub Desktop.
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