mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-13 03:26:21 +01:00
Test memoize enhanceContent
This commit is contained in:
parent
f56a44ac97
commit
32bf258bbf
1 changed files with 3 additions and 1 deletions
|
@ -1,9 +1,10 @@
|
||||||
import emojifyText from './emojify-text';
|
import emojifyText from './emojify-text';
|
||||||
|
import mem from './mem';
|
||||||
|
|
||||||
const fauxDiv = document.createElement('div');
|
const fauxDiv = document.createElement('div');
|
||||||
const whitelistLinkClasses = ['u-url', 'mention', 'hashtag'];
|
const whitelistLinkClasses = ['u-url', 'mention', 'hashtag'];
|
||||||
|
|
||||||
function enhanceContent(content, opts = {}) {
|
function _enhanceContent(content, opts = {}) {
|
||||||
const { emojis, postEnhanceDOM = () => {} } = opts;
|
const { emojis, postEnhanceDOM = () => {} } = opts;
|
||||||
let enhancedContent = content;
|
let enhancedContent = content;
|
||||||
const dom = document.createElement('div');
|
const dom = document.createElement('div');
|
||||||
|
@ -250,6 +251,7 @@ function enhanceContent(content, opts = {}) {
|
||||||
|
|
||||||
return enhancedContent;
|
return enhancedContent;
|
||||||
}
|
}
|
||||||
|
const enhanceContent = mem(_enhanceContent);
|
||||||
|
|
||||||
const defaultRejectFilter = [
|
const defaultRejectFilter = [
|
||||||
// Document metadata
|
// Document metadata
|
||||||
|
|
Loading…
Reference in a new issue