mirror of
https://github.com/flarum/core.git
synced 2025-07-25 18:51:40 +02:00
Fix live preview
This commit is contained in:
@@ -70,3 +70,5 @@ app.initializers.add('flarum-mentions', function() {
|
|||||||
// Remove post mentions when rendering post previews.
|
// Remove post mentions when rendering post previews.
|
||||||
getPlainContent.removeSelectors.push('a.PostMention');
|
getPlainContent.removeSelectors.push('a.PostMention');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export * from './utils/textFormatter';
|
||||||
|
@@ -65,7 +65,7 @@ class FormatPostMentions
|
|||||||
|
|
||||||
$tag->filterChain
|
$tag->filterChain
|
||||||
->prepend([static::class, 'addId'])
|
->prepend([static::class, 'addId'])
|
||||||
->setJS('function(tag) { return System.get("flarum/mentions/utils/textFormatter").filterPostMentions(tag); }');
|
->setJS('function(tag) { return flarum.extensions["flarum-mentions"].filterPostMentions(tag); }');
|
||||||
|
|
||||||
$configurator->Preg->match('/\B@(?<username>[a-z0-9_-]+)#(?<id>\d+)/i', $tagName);
|
$configurator->Preg->match('/\B@(?<username>[a-z0-9_-]+)#(?<id>\d+)/i', $tagName);
|
||||||
}
|
}
|
||||||
|
@@ -60,7 +60,7 @@ class FormatUserMentions
|
|||||||
|
|
||||||
$tag->template = '<a href="{$PROFILE_URL}{@username}" class="UserMention">@<xsl:value-of select="@displayname"/></a>';
|
$tag->template = '<a href="{$PROFILE_URL}{@username}" class="UserMention">@<xsl:value-of select="@displayname"/></a>';
|
||||||
$tag->filterChain->prepend([static::class, 'addId'])
|
$tag->filterChain->prepend([static::class, 'addId'])
|
||||||
->setJS('function(tag) { return System.get("flarum/mentions/utils/textFormatter").filterUserMentions(tag); }');
|
->setJS('function(tag) { return flarum.extensions["flarum-mentions"].filterUserMentions(tag); }');
|
||||||
|
|
||||||
$configurator->Preg->match('/\B@(?<username>[a-z0-9_-]+)(?!#)/i', $tagName);
|
$configurator->Preg->match('/\B@(?<username>[a-z0-9_-]+)(?!#)/i', $tagName);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user