Closed pmario closed 3 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
tiddlywiki5 | ✅ Ready (Inspect) | Visit Preview | Jun 6, 2024 11:39am |
@Jermolene -- Please confirm that the following code should create the output as shown in the screenshtot.
\define re() (color)|(colour)ed
\define str() Something coloured
{{{ [<str>splitregexp<re>join[, ]] }}}
---
{{{ [<str>splitregexp<re>] }}}
Hi @pmario the issue here is that the JS split operator is essentially useless when used with a regex that includes capture groups.
So, I think the best we can do is coerce undefined to an empty string, and add a warning to the docs for the split operator explaining why it should not be used with capture groups.
So, I think the best we can do is coerce undefined to an empty string, and add a warning to the docs for the split operator explaining why it should not be used with capture groups.
OK - I'll some info to the docs too.
@Jermolene -- This should work as requested now + a bit more docs
Thank you @pmario
This PR makes sure split(regex) used by the
splitregexp
operator returns an array of strings. It fixes: #8216 and #8213Code to test with