XL fix parsers
This commit is contained in:
parent
e63aacf0c1
commit
4c1436537f
|
@ -41,7 +41,7 @@ module.exports = (() => {
|
||||||
twitter_username: ''
|
twitter_username: ''
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
version: '1.3.27',
|
version: '1.3.29',
|
||||||
description: 'Simple library to complement plugins with shared code without lowering performance. Also adds needed buttons to some plugins.',
|
description: 'Simple library to complement plugins with shared code without lowering performance. Also adds needed buttons to some plugins.',
|
||||||
github: 'https://github.com/1Lighty',
|
github: 'https://github.com/1Lighty',
|
||||||
github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/1XenoLib.plugin.js'
|
github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/1XenoLib.plugin.js'
|
||||||
|
@ -929,19 +929,21 @@ module.exports = (() => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const FancyParser = (() => {
|
const FancyParser = (() => {
|
||||||
const ParsersModule = WebpackModules.getByProps('parseAllowLinks', 'parse');
|
const ParsersModule = WebpackModules.getByProps('astParserFor', 'parse');
|
||||||
try {
|
try {
|
||||||
const DeepClone = WebpackModules.find(m => m.default && m.default.toString().indexOf('/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(') !== -1 && !m.useVirtualizedAnchor).default;
|
const DeepClone = WebpackModules.find(m => m.default && m.default.toString().indexOf('/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(') !== -1 && !m.useVirtualizedAnchor).default;
|
||||||
const ReactParserRules = WebpackModules.find(m => m.default && m.default.toString().search(/function\(\){return \w}$/) !== -1).default; /* thanks Zere for not fixing the bug ._. */
|
const ReactParserRules = WebpackModules.find(m => m.default && m.default.toString().search(/function\(\){return \w}$/) !== -1).default; /* thanks Zere for not fixing the bug ._. */
|
||||||
const FANCY_PANTS_PARSER_RULES = DeepClone([WebpackModules.getByProps('RULES', 'ALLOW_LINKS_RULES').ALLOW_LINKS_RULES, ReactParserRules()]);
|
const FANCY_PANTS_PARSER_RULES = DeepClone([WebpackModules.getByProps('RULES').RULES, ReactParserRules()]);
|
||||||
FANCY_PANTS_PARSER_RULES.image = WebpackModules.getByProps('defaultParse').defaultRules.image;
|
const { defaultRules } = WebpackModules.getByProps('defaultParse');
|
||||||
|
FANCY_PANTS_PARSER_RULES.image = defaultRules.image;
|
||||||
|
FANCY_PANTS_PARSER_RULES.link = defaultRules.link;
|
||||||
return ParsersModule.reactParserFor(FANCY_PANTS_PARSER_RULES);
|
return ParsersModule.reactParserFor(FANCY_PANTS_PARSER_RULES);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Logger.stacktrace('Failed to create special parser', e);
|
Logger.stacktrace('Failed to create special parser', e);
|
||||||
try {
|
try {
|
||||||
return ParsersModule.parseAllowLinks;
|
return ParsersModule.parse;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Logger.stacktrace('FUCKING CUNT, parseAllowLinks bad', e);
|
Logger.stacktrace('Failed to get even basic parser', e);
|
||||||
return e => e;
|
return e => e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue