Skip to content

Commit

Permalink
fix, feat:
Browse files Browse the repository at this point in the history
* readme wrong example
* html xss formatting
  • Loading branch information
SnowFireWolf committed Feb 3, 2022
1 parent efc2f66 commit 1b7b61c
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ console.log(autoJsonResult);
<span style="color: #FFAA00;font-weight: bold;">Viper </span><span style="color: #AAAAAA;">┃ </span><span style="color: #FFFF55;">Summer Sale</span><span style="color: #FFFFFF;"> at </span><span style="color: #FFAA00;">store.vipermc.net<br/></span><span style="color: #AAAAAA;">► </span><span style="color: #FFFF55;">EOTW </span><span style="color: #FFFFFF;">on </span><span style="color: #FFAA00;">Infernal</span><span style="color: #FFFFFF;"> is this Thursday at </span><span style="color: #FFFF55;">5PM ET</span><span style="color: #FFFFFF;">.</span>
*/

let textExample = {"text":"","extra":[{"text":"Hypixel Network ","extra":[{"text":"","extra":[{"text":"1.8/1.9/1.10/1.11/1.12 ","extra":[{"text":"","extra":[{"text":"NEW PTL GAME:","extra":[{"text":"","extra":[{"text":" THE BRIDGE","extra":[],"bold":true}],"color":"acqua"}],"bold":true}],"color":"yellow"}],"color":"red"}],"color":"gray"}],"color":"green"}]};
let textExample = "§aHypixel Network §7§c1.8/1.9/1.10/1.11/1.12 §e§lNEW PTL GAME:§b§l THE BRIDGE";
let autoTextResult = motdParser.autoToHtml(textExample);
console.log(autoTextResult);

/* auto Text Result, callback HTML:
<span style="color: #AA00AA;"></span><span style="color: #AA00AA;text-decoration: line-through;">                  </span><span style="color: #FFAA00;text-decoration: line-through;">></span><span style="color: #AAAAAA;text-decoration: line-through;"></span><span style="color: #AAAAAA;font-weight: bold;"></span><span style="color: #FFAA00;font-weight: bold;"></span><span style="color: #FFAA00;font-weight: bold;">></span><span style="color: #FFAA00;font-weight: bold;"></span><span style="color: #FFAA00;font-weight: bold;">[</span><span style="color: #AA00AA;font-weight: bold;"></span><span style="color: #AA00AA;font-weight: bold;"></span><span style="color: #AA00AA;font-style: italic;">Purple </span><span style="color: #555555;font-style: italic;"></span><span style="color: #555555;font-weight: bold;"></span><span style="color: #555555;font-style: italic;">Prison</span><span style="color: #FFAA00;font-style: italic;"></span><span style="color: #FFAA00;font-weight: bold;">]</span><span style="color: #FFAA00;font-weight: bold;"></span><span style="color: #FFAA00;font-weight: bold;"><</span><span style="color: #FFAA00;font-weight: bold;"><</span><span style="color: #AA00AA;font-weight: bold;"></span><span style="color: #AA00AA;text-decoration: line-through;">                     </span><span style="color: #AA00AA;"> </span><span style="color: #AAAAAA;">   </span><span style="color: #AA00AA;"></span><span style="color: #AA00AA;mc_obfuscated;"></span><span style="color: #AA00AA;font-weight: bold;">;;;</span><span style="color: #AA00AA;">  </span><span style="color: #FF55FF;"></span><span style="color: #FF55FF;font-weight: bold;">NEW BLACK-MARKET </span><span style="color: #AA00AA;font-weight: bold;"></span><span style="color: #AA00AA;font-weight: bold;">» </span><span style="color: #FFAA00;font-weight: bold;"></span><span style="color: #FFAA00;font-weight: bold;">/BLACKMARKET  </span><span style="color: #AA00AA;font-weight: bold;"></span><span style="color: #AA00AA;mc_obfuscated;"></span><span style="color: #AA00AA;font-weight: bold;">;;;</span>
<span style="color: #55FF55;">Hypixel Network <span style="color: #AAAAAA;"><span style="color: #FF5555;">1.8/1.9/1.10/1.11/1.12 <span style="color: #FFFF55;"><span style="font-weight: bold;">NEW PTL GAME:<span style="color: acqua;"><span style="font-weight: bold;"> THE BRIDGE</span></span></span></span></span></span></span>
*/
```

Expand Down
2 changes: 1 addition & 1 deletion dist/motdParser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
/*
* minecraft motd parser v1.0.5
* minecraft motd parser v1.0.8
* (c) 2021 Kevin Zheng
* Released under the MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/types.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
/*
* minecraft motd parser v1.0.5
* minecraft motd parser v1.0.8
* (c) 2021 Kevin Zheng
* Released under the MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
/*
* minecraft motd parser v1.0.5
* minecraft motd parser v1.0.8
* (c) 2021 Kevin Zheng
* Released under the MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sfirew/mc-motd-parser",
"description": "Minecraft Server MOTD Parser, can convert to html, json, text.",
"version": "1.0.7-readme-update",
"version": "1.0.8",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/motdParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* minecraft motd parser v1.0.7
* minecraft motd parser v1.0.8
* (c) 2021 Kevin Zheng
* Released under the MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* minecraft motd parser v1.0.7
* minecraft motd parser v1.0.8
* (c) 2021 Kevin Zheng
* Released under the MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* minecraft motd parser v1.0.7
* minecraft motd parser v1.0.8
* (c) 2021 Kevin Zheng
* Released under the MIT license
*/
Expand Down

0 comments on commit 1b7b61c

Please sign in to comment.