Closed kirsan31 closed 6 years ago
Makes sense to me, thanks, I'll change it.
Now that pygments
is generating the html, I've got it putting the line numbers in its own table, so the code is still select-able on its own. This is in the develop
branch, but is live on the bot. If this is good for you, please go ahead and close this issue.
I'm Not at home Now and Can't Test it by Myself. But my friend told me that QLabel can't handle new formatting :-( I used QLabel and qtextedit to view html directly in telegram. You can see it under spoiler in my 1 post.
Yes, QLabel/QTextEdit rendering completely broken :( Same code:
QLabel and QTextEdit are the only controls for html rendering in tdesktop for now :( It Will be very handful if we can view your files in tdesktop (with some modifications of course).
QLabel/QTextEdit supported HTML Subset. But, IMHO, simple removing line numbers make all happy :)
I'd prefer to stick with pygments now than revert to highlight, so I'll see if I can fiddle with it and get a more compatible html output.
Is there a standalone command I can use to test html rendering with QLabel/QTextEdit?
Is there a standalone command I can use to test html rendering with QLabel/QTextEdit?
Sorry, I don't know :( I Pushed last changes (not final) to my Fork of tdesktop. If you can't compile it, here windows binary: Telegram_mod.zip It open html file in QLabel, if it's size < 50 kb and resulting view fit in your screen resolution.
Why not use qwebengineview
?
The initial reason for this issue, selecting and copying code without interference from line numbers, is resolved.
For another requirement, please open a new issue.
@AndydeCleyre
Why not use qwebengineview?
Because qwebengineview cannot be linked statically, so it's no way to use it in Tdesktop. But anyway, it's very monstrous and slow ...
@kirsan31 FYI the backend has been changed back to highlight, so the html may render better for you. Selection independent of line numbers seems to be working.
Because, line numbers prevent simple copy paste of generated code!
my 50 cents...
![html](https://user-images.githubusercontent.com/17767561/39043914-5227df5e-4497-11e8-8ffb-3e093e0896a0.gif)