this repo has no description
1import { ExtensionWebpackModule, Patch } from "@moonlight-mod/types";
2
3export const patches: Patch[] = [
4 {
5 find: "/^(¯\\\\_\\(ツ\\)_\\/¯)/.exec",
6 replace: [
7 {
8 match: /={newline:(.+?)},(.{1,2})=\(0,/,
9 replacement: (_, rules, RULES) =>
10 `=require("markdown_markdown")._addRules({newline:${rules}}),${RULES}=(0,`
11 },
12 {
13 match: /(?<=var (.{1,2})={RULES:.+?})/,
14 replacement: (_, rulesets) =>
15 `;require("markdown_markdown")._applyRulesetBlacklist(${rulesets});`
16 }
17 ]
18 },
19 {
20 find: "then you probably need to add it to this file so that the rich chat box understands it.",
21 replace: [
22 {
23 match: /(.)={link:{(.+?)},(.)=new Set/,
24 replacement: (_, rulesDef, rules, syntaxBefore) =>
25 `__slateRules,${rulesDef}=__slateRules=require("markdown_markdown")._addSlateRules({link:{${rules}}),${syntaxBefore}=new Set`
26 },
27 {
28 match:
29 /(originalMatch:.}=(.);)(.+?)case"emoticon":(return .+?;)(.+?)case"link":{(.+?)}default:/,
30 replacement: (
31 _,
32 start,
33 rule,
34 body,
35 plaintextReturn,
36 otherRules,
37 inlineStyleBody
38 ) =>
39 `${start}if(${rule}.type.startsWith("__moonlight_")){if(__slateRules[${rule}.type].type=="inlineStyle"){${inlineStyleBody}}else{${plaintextReturn}}}${body}case"emoticon":${plaintextReturn}${otherRules}case"link":{${inlineStyleBody}}default:`
40 }
41 ]
42 },
43 {
44 find: '"Slate: Unknown decoration attribute: "',
45 replace: {
46 match: /=({strong:.+?});/,
47 replacement: (_, rules) =>
48 `=require("markdown_markdown")._addSlateDecorators(${rules});`
49 }
50 }
51];
52
53export const webpackModules: Record<string, ExtensionWebpackModule> = {
54 markdown: {}
55};