This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- https://stackoverflow.com/questions/5846137/script-inside-href-how-to --> | |
| <a href="javascript:location='http://www.linkimprov.com/?ref='+encodeURI(location.href.match(/(?=https?:\/\/)?(?=www\.)?(.*)/)[1]).substring(7);"></a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://stackoverflow.com/questions/14213848/difference-between-and | |
| // Both will match any sequence of one or more characters. The difference is that: | |
| // .+ is greedy and consumes as many characters as it can. | |
| // .+? is reluctant and consumes as few characters as it can. | |
| var r0 = /\$[\s\S]+\$/g; | |
| r0.exec('$s\nda$sd\n$') // match: $s\nda$sd\n$ | |
| var r1 = /\$[\s\S]+?\$/g; | |
| r1.exec('$s\ndasd\n$') // match: $s\nda$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://stackoverflow.com/questions/1979884/how-to-use-javascript-regex-over-multiple-lines | |
| // use ? for non-greedy mode | |
| // () use to capture | |
| var regex = /\$([\s\S]+?)\$/g; | |
| regex.exec('$s\ndasd\n$'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This one is wrong | |
| <script type="text/javascript">document.write('<img src="http://chart.apis.google.com/chart?cht=tx&chl=' + escape('\\\\frac{1}{2}').replace(' ',"%20") + '" alt="">');</script> | |
| // This one is right | |
| // learn it from https://katex.org/docs/api.html | |
| <script type="text/javascript">document.write('<img src="http://chart.apis.google.com/chart?cht=tx&chl=' + String.raw`$1`.replace(' ',"%20") + '" />');</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //https://github.com/parcel-bundler/parcel/issues/470 | |
| parcel build index.html --public-url ./ |
NewerOlder