xgqfrms / FEIQA

FEIQA: Front End Interviews Question & Answers
https://feiqa.xgqfrms.xyz
MIT License
6 stars 0 forks source link

XML & HTML (spaces to \n \t) #52

Open xgqfrms opened 5 years ago

xgqfrms commented 5 years ago

XML & HTML

spaces to \n, \t

</Js lang="jes6">
    <Array type="String">
        <Item>text/html</Item>
        <Item>text/css</Item>
        <Item>application/javascript</Item>
    </Array>
</Js>
xgqfrms commented 5 years ago

https://stackoverflow.com/questions/17214377/how-to-convert-spaces-and-newlines-from-textarea-to-html

https://stackoverflow.com/questions/10805125/how-to-remove-all-line-breaks-from-a-string

https://stackoverflow.com/questions/6507056/replace-all-whitespace-characters

xgqfrms commented 5 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-quantifier

https://regexper.com/#%2F%5E(%5Cw%2B)%5C%3A%5C%2F%5C%2F(%5B%5E%5C%2F%5D%2B)%5C%2F(.*)%24%2F

regex & var

regex & var & js

https://stackoverflow.com/questions/494035/how-do-you-use-a-variable-in-a-regular-expression

https://www.hacksparrow.com/javascript-use-variables-with-regular-expressions.html

https://stackoverflow.com/questions/1695633/how-to-pass-a-variable-into-regex-in-jquery-javascript

xgqfrms commented 5 years ago

OK

image

</Js lang="jes6">
    <Array type="String">
        <Item>text/html</Item>
        <Item>text/css</Item>
        <Item>application/javascript</Item>
    </Array>
</Js>

let xml =`</Js lang="jes6">
    <Array type="String">
        <Item>text/html</Item>
        <Item>text/css</Item>
        <Item>application/javascript</Item>
    </Array>
</Js>`;

xml.replace(/(\s{4})/gi, `&nbsp;`.repeat(4));
xgqfrms commented 5 years ago

image

https://regexper.com/#%2F%28%5Cs%7B4%7D%29%2Fgi

xgqfrms commented 5 years ago

` =>\t`

4 spaces to \t

image

xgqfrms commented 5 years ago

unicode

utf-8 & how to get unicode in js?

https://stackoverflow.com/questions/7063255/how-can-i-convert-a-string-into-a-unicode-character

https://flaviocopes.com/javascript-unicode/

java

https://www.javacodex.com/Strings/Get-Unicode-Values-Of-A-String https://stackoverflow.com/questions/2220366/get-unicode-value-of-a-character https://stackoverflow.com/questions/8504615/get-unicode-value-of-character

xgqfrms commented 5 years ago

image



let emoji = `\uD83D\uDC69`;
console.log(`emoji =`, emoji);
// emoji = 👩

``

https://flaviocopes.com/javascript-unicode#emojis
xgqfrms commented 5 years ago

https://flaviocopes.com/unicode/#normalization

image

xgqfrms commented 5 years ago

https://unicode.org/emoji/charts/full-emoji-list.html

https://lingojam.com/WeirdTextGenerator

text art


𝔵𝔤𝔮𝔣𝔯𝔪𝔰

𝖝𝖌𝖖𝖋𝖗𝖒𝖘

💋💜  𝐱ģqf𝕣Μˢ  🍮🐺

𝔁𝓰𝓺𝓯𝓻𝓶𝓼

𝓍𝑔𝓆𝒻𝓇𝓂𝓈

𝕩𝕘𝕢𝕗𝕣𝕞𝕤

xgqfrms

・゚°  🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀  °゚・

xɢQꜰʀᴍꜱ

sɯɹɟbɓx

x⃣   g⃣   q⃣   f⃣   r⃣   m⃣   s⃣

x⃞    g⃞    q⃞    f⃞    r⃞    m⃞    s⃞

🅇🄶🅀🄵🅁🄼🅂

ꙅmɿᎸpǫx

x̵͖͆̀̆́̇ḡ̷̯̟̪͙͇̳͕̎̆̈̊q̷̛̪̒̇̅͑̽͛̐̂f̵̧̨̘̗̝̯͉̖̺̥͛̚r̶̥̪̪̭̝̬̯͉̾̾͌͑́́̏͠͠m̴̯͉̖͎̹̠̯͙̻̣̽s̴̨͓̥̱̬̽̓́͑̊́̓

🆇🅶🆀🅵🆁🅼🆂

ₓgqfᵣₘₛ

ˣᵍqᶠʳᵐˢ

ⓧⓖⓠⓕⓡⓜⓢ

אﻮợŦг๓ร

xɠϙϝɾɱʂ

Ӽɢզʄʀʍֆ

ጀᎶᎤᎦᏒᎷᏕ

ҳɠզʄཞɱʂ

xງ๑fr๓Ş

𝐱𝐠𝐪𝐟𝐫𝐦𝐬

𝘹𝘨𝘲𝘧𝘳𝘮𝘴

𝙭𝙜𝙦𝙛𝙧𝙢𝙨

𝚡𝚐𝚚𝚏𝚛𝚖𝚜

XGQFЯMƧ

χgqƒямѕ

xgq£rm§

Ӿ₲Q₣Ɽ₥₴

乂ᎶɊ千尺爪丂

メムゐキ尺ᄊ丂

【x】【g】【q】【f】【r】【m】【s】

『x』『g』『q』『f』『r』『m』『s』

≋x≋g≋q≋f≋r≋m≋s≋

░x░g░q░f░r░m░s░

(っ◔◡◔)っ ♥ xgqfrms ♥

xgqfrms 苛位ま

xgqfrms (苛位ま)

【xgqfrms】

˜”*°•.˜”*°• xgqfrms •°*”˜.•°*”˜

[̲̅x][̲̅g][̲̅q][̲̅f][̲̅r][̲̅m][̲̅s]

x҉g҉q҉f҉r҉m҉s҉

×ցզƒɾʍʂ

᙭Gᑫᖴᖇᗰᔕ

᙭ᘜᕴᖴᖇᘻS

x̶g̶q̶f̶r̶m̶s̶

x̴g̴q̴f̴r̴m̴s̴

x̷g̷q̷f̷r̷m̷s̷

x̲g̲q̲f̲r̲m̲s̲

x̳g̳q̳f̳r̳m̳s̳

x̾g̾q̾f̾r̾m̾s̾

x♥g♥q♥f♥r♥m♥s

x͎g͎q͎f͎r͎m͎s͎

x͓̽g͓̽q͓̽f͓̽r͓̽m͓̽s͓̽

Wingdings: ⌧︎♑︎❑︎♐︎❒︎❍︎⬧︎

•]••´º´•»   🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀   »•´º´••]•

🍫  🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀  🍫

🍧  🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀  🍧

°°°·.°·..·°¯°·._.·   🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀   ·._.·°¯°·..·°.·°°°

🕊  🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀  🕊

🍩😾  ᙭g𝓆𝐟ᖇ𝓜𝓈  ♬💝

••.•´¯`•.•• ЖⒼǪFŕᵐ𝐒 ••.•´¯`•.••

💋♖  𝓧g𝐐𝒇ʳMᔕ  🎯👊

🐜✌  ⓧģ𝕢ℱя𝓜𝓈  😎♪

🎉♠  Ⓧģ𝐪𝐅尺ᗰ𝓢  💝☜

░▒▓█ 𝐱ᎶQƒR𝐦ร █▓▒░

🍩🎄  𝕏GⓆℱRM𝐒  💀✋

💀💀  𝔁g𝐪𝕗尺M𝕤  😲🐤

☠🌷  xᎶq千яᗰs  🍟☜

💞👺  𝔵ق𝔮𝐟Řмş  👮🐙

🐻🐺  ᙭Ğ𝔮𝐅ŕ๓s  💀🌷

๑۞๑,¸¸,ø¤º°`°๑۩ xĞ𝔮千гmѕ ๑۩ ,¸¸,ø¤º°`°๑۞๑

💔💣  𝕏ᵍ𝐪𝒻RMⓢ  ♚👤

【。_。】 𝓧ⓖℚ𝒇𝔯M𝕤 【。_。】

☹🐍  X𝔤qᶠᖇ爪𝔰  ♪♡

◦•●◉✿ Ⓧ𝕘q𝕗ŕмˢ ✿◉●•◦

🌷♨  Ж𝑔ợⒻRm𝓢  👤♚

💋🍬  𝕏𝓰𝕢𝐟𝓡M𝐬  🍭♦

¤¸¸.•´¯`•¸¸.•..>> 𝕩Ꮆⓠ千Ⓡм𝕊 <<..•.¸¸•´¯`•.¸¸¤

♙🎄  ᙭ǤℚⓕⓇⓜ𝕤  ☯✌

👑👤  ⓧ𝐠𝐐𝔽𝓇𝕄ş  👣😳

🎂  🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀  🎂

🍡  🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀  🍡

•´¯`•.   🎀  𝓍𝑔𝓆𝒻𝓇𝓂𝓈  🎀   .•`¯´•
xgqfrms commented 5 years ago

https://github.com/bestiejs/punycode.js https://en.wikipedia.org/wiki/Diacritic

https://github.com/combatwombat/Lunicode.js

xgqfrms commented 5 years ago

bug

spaces & &nbsp; ???

image


const geXML = (data = ``) => {
    let xml = data.replace(/<\//ig, `^YYY`).replace(/</ig, `^XXX`).replace(/>/ig, `^GGG`);
    // console.log(`xml = `, xml);
    xml = xml.replace(/\^XXX(\w+)\s/ig, `&lt;<span class="xml-heiglight-key">$1</span> `).replace(/\^XXX/ig, `&lt;<span class="xml-heiglight-key">`).replace(/\^YYY/ig, `&lt;/<span class="xml-heiglight-key">`).replace(/\^GGG/ig, `</span>&gt;`).replace(/\t/ig, `    `.repeat(4)).replace(/[\n]+/ig, `<br/>`);
    // xml = xml.replace(/\^XXX(\w+)\s/ig, `&lt;<span class="xml-heiglight-key">$1</span> `).replace(/\^XXX/ig, `&lt;<span class="xml-heiglight-key">`).replace(/\^YYY/ig, `&lt;/<span class="xml-heiglight-key">`).replace(/\^GGG/ig, `</span>&gt;`).replace(/\t/ig, `&nbsp;`.repeat(4)).replace(/[\n]+/ig, `<br/>`);
    return xml;
};
xgqfrms commented 5 years ago

http://www.runoob.com/mongodb/mongodb-create-database.html https://www.kancloud.cn/wangfupeng/wangeditor3/404586

xgqfrms commented 3 years ago

text to JSON

https://github.com/xgqfrms/FEIQA/issues/99