morethanwords / tweb

Telegram Web K, GPL v3
https://web.telegram.org/k/
GNU General Public License v3.0
1.86k stars 596 forks source link

Fix sending HTML with comment #336

Open p2world opened 4 months ago

p2world commented 4 months ago

For example: Copy a link on Windows the HTML in clipboard will be:

<html> 
<body> 
<!--StartFragment--><a href="https://web.telegram.org/k/">Telegram Web</a><!--EndFragment--> 
</body> 
</html>

The * in regex is greedy, it will match to last comment ending, out put became this:

<html> 
<body> 

</body> 
</html>

*? is the lazy mode will only match to the first endding, result will like this:

<html> 
<body> 
<a href="https://web.telegram.org/k/">Telegram Web</a>
</body> 
</html>