BLCC#60989 ook in de bon de mention-bb-code strippen

svn path=/Website/trunk/; revision=55488
This commit is contained in:
2022-04-04 14:40:54 +00:00
parent e38c3e6572
commit 31872f7bea
2 changed files with 30 additions and 15 deletions

View File

@@ -123,21 +123,20 @@
// Checking for [link] url (|optionaltext) [/link]
// or [url] url (|optionaltext) [/url]
var strre = "\\[(link|url)\\](.*?)\\[\\/(?:\\1)\\]";
var strLinkre = "^((ftp|http|https):\\/\\/|(mailto|tel):)";
var re = new RegExp(strre, "gi");
var allowedLinkRegex = new RegExp(strLinkre, "gi");
var matched = waarde.match(re);
var allowedLinkRegex = new RegExp("^((ftp|http|https):\\/\\/|(mailto|tel):)", "i"); // S("allowedLinkRegex")
var matched = waarde.match(new RegExp(strre, "gi"));
if (matched != null)
{
var url = "";
var label = "";
for (var i = 0; i < matched.length; i++)
{
if (matched[i].match(re)) // om RegExp.$2 te bepalen
var groups = matched[i].match(new RegExp(strre, "i")); // Zonder 'g'lobal-flag
if (groups)
{
// RegExp.$1 = "link" of "url" (wordt verder niet gebruikt)
// RegExp.$2 = url (|optionaltext)
var result = RegExp.$2.split("|");
// groups[1] = "link" of "url" (wordt verder niet gebruikt)
// groups[2] = url (|optionaltext)
var result = groups[2].split("|");
if (result.length > 0)
{
var safe_url = safe.htmlattr(result[0]);
@@ -158,6 +157,24 @@
}
}
// Checking for [mention] prs_key | prs_name [/mention] as used in notes
// Deze strippen we ipv parsen, je bent het immers zelf
strre = "\\[(mention)\\](\\d+)\\|(.+)\\[\\/(?:\\1)\\]";
var matched = waarde.match(new RegExp(strre, "gi"));
if (matched != null)
{
for (var i = 0; i < matched.length; i++)
{
var groups = matched[i].match(new RegExp(strre, "i")); // Zonder 'g'lobal-flag
if (groups)
{ // groups[1] = "mention" (wordt verder niet gebruikt)
// groups[2] = prs_key
// groups[3] = prs_name
safehtml = safehtml.replace(safe.html(matched[i]), "@" + safe.html(groups[3]));
}
}
}
for (var i = 0; i < safepairs.length; i++)
{
var code = safepairs[i];
@@ -1660,7 +1677,7 @@ END:VCALENDAR
</td>
<td colspan="3" style="padding-top:10px;">
<xsl:call-template name="linebreaks">
<xsl:with-param name="string" select="notes/note[key=$mx_key]/omschrijving"/>
<xsl:with-param name="string" select="fclt:fclthtml(notes/note[key=$mx_key]/omschrijving)"/>
</xsl:call-template>
</td>
</tr>
@@ -2055,7 +2072,7 @@ END:VCALENDAR
</td>
<td colspan="5" style="padding-top:15px;padding-bottom:10px;">
<xsl:call-template name="linebreaks">
<xsl:with-param name="string" select="notes/note[key=$ox_key]/omschrijving"/>
<xsl:with-param name="string" select="fclt:fclthtml(notes/note[key=$ox_key]/omschrijving)"/>
</xsl:call-template>
</td>
</tr>
@@ -3175,7 +3192,7 @@ END:VCALENDAR
</td>
<td colspan="3" style="padding-top:10px;" class="value">
<xsl:call-template name="linebreaks">
<xsl:with-param name="string" select="notes/note[key=$mx_key]/omschrijving"/>
<xsl:with-param name="string" select="fclt:fclthtml(notes/note[key=$mx_key]/omschrijving)"/>
</xsl:call-template>
</td>
</tr>
@@ -3607,7 +3624,7 @@ END:VCALENDAR
</td>
<td colspan="3" style="padding-top:10px;" class="value">
<xsl:call-template name="linebreaks">
<xsl:with-param name="string" select="notes/note[key=$mx_key]/omschrijving"/>
<xsl:with-param name="string" select="fclt:fclthtml(notes/note[key=$mx_key]/omschrijving)"/>
</xsl:call-template>
</td>
</tr>