mirror of
https://github.com/flarum/core.git
synced 2025-08-04 23:47:32 +02:00
Make formatText util an object so it can be extended
This commit is contained in:
11
js/forum/src/utils/Formatter.js
Normal file
11
js/forum/src/utils/Formatter.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/*global s9e*/
|
||||
|
||||
export default {
|
||||
format(text) {
|
||||
const elm = document.createElement('div');
|
||||
|
||||
s9e.TextFormatter.preview(text || '', elm);
|
||||
|
||||
return elm.innerHTML;
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
export default function formatText(text) {
|
||||
const elm = document.createElement('div');
|
||||
|
||||
s9e.TextFormatter.preview(text || '', elm);
|
||||
|
||||
return elm.innerHTML;
|
||||
}
|
Reference in New Issue
Block a user