mirror of
https://github.com/flarum/core.git
synced 2025-08-04 23:47:32 +02:00
@@ -34,9 +34,15 @@ export function slug(string) {
|
||||
* @return {String}
|
||||
*/
|
||||
export function getPlainContent(string) {
|
||||
return $('<div/>').html(string.replace(/(<\/p>|<br>)/g, '$1 ')).text();
|
||||
const dom = $('<div/>').html(string.replace(/(<\/p>|<br>)/g, '$1 '));
|
||||
|
||||
dom.find(getPlainContent.removeSelectors.join(',')).remove();
|
||||
|
||||
return dom.text();
|
||||
}
|
||||
|
||||
getPlainContent.removeSelectors = ['blockquote'];
|
||||
|
||||
/**
|
||||
* Make a string's first character uppercase.
|
||||
*
|
||||
|
Reference in New Issue
Block a user