New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL support #335

Closed
yousufinternet opened this Issue Sep 27, 2016 · 13 comments

Comments

Projects
None yet
2 participants
@yousufinternet

yousufinternet commented Sep 27, 2016

Hi,
Is there any way to add a RTL (right to left) text in the mark down format? , I have no problem displaying RTL text (Arabic, Hebrew, Persian..etc) correctly in the editor, but the RTL text appears LTR in the md viewer, so my current setup is hiding the md viewer, and using the editor only.

@pbek pbek added the enhancement label Sep 27, 2016

@pbek

This comment has been minimized.

Owner

pbek commented Sep 27, 2016

Can you please post an arabic (or something else with RTL) note file, so I have something to test with.

@pbek pbek added this to the 16.09.16 milestone Sep 27, 2016

@pbek

This comment has been minimized.

Owner

pbek commented Sep 27, 2016

I think I managed to do it myself.

16.09.16

  • added RTL support for the markdown preview
    • you can turn it on in the interface settings
@yousufinternet

This comment has been minimized.

yousufinternet commented Sep 27, 2016

Sure, Thanks for the quick reply!

مرحباً هذه ملاحظة تجريبية this is a test note شكراً لفريق كـأون نوت

It's not showing currectly here on this site either.
this behaviour becomes especialy troubling when having LTR text in between the RTL text.

you can see in the screenshot the deffirence between the display in the md preview pane and the editor, the correct display is the editor.

screenshot from 2016-09-27 18-44-00
screenshot from 2016-09-27 18-43-48

Thanks in advance

@yousufinternet

This comment has been minimized.

yousufinternet commented Sep 27, 2016

Hey thank you very much.
but I was thinking about something more "automatic", because I also have many LTR notes, and it might be just a little bit annoying to swich the view every time for each note.
but if it is not possible this is very ok with me, and thank you very much for the quick help.

@pbek

This comment has been minimized.

Owner

pbek commented Sep 27, 2016

I had to set specific CSS styles in the note view (text-align: right; direction: rtl;), like it has to be done in a webpage. I currently see no way how that could be detected.

@pbek

This comment has been minimized.

Owner

pbek commented Sep 27, 2016

If you find some Qt and/or HTML/CSS specific information, please let me know.

@yousufinternet

This comment has been minimized.

yousufinternet commented Sep 27, 2016

Thats ok.

I think in Qt you can add buttons for making the text RTL or LTR while editing the note.

I used to use everpad (Evernote thirdparty linux client), and I had to tweak their note editor by adding the following code:

        (QWebPage.SetTextDirectionLeftToRight,
            ['format-text-direction-ltr', 'everpad-text-direction-ltr']),
        (QWebPage.SetTextDirectionRightToLeft,
            ['format-text-direction-rtl', 'everpad-text-direction-rtl']),

to the editing toolbar to show RTL and LTR buttons while editing the note, if that is possible here it would be great too.

@pbek

This comment has been minimized.

Owner

pbek commented Sep 27, 2016

You would want to click a RTL button for ever note with RTL text? It would be far more convenient to do that automatically.

@yousufinternet

This comment has been minimized.

yousufinternet commented Sep 27, 2016

No, I want to be able to write RTL notes or RTL paragraphs whithin notes, when I view these notes later they would appear RTL just like any other mark down formating stored in the note.

I guess nothing automatic could be done for my previous notes, or it is a bit complicated.

@pbek

This comment has been minimized.

Owner

pbek commented Sep 27, 2016

I could only imagine that maybe you can find some magic CSS style (that is also supported by QTextBrowser) that is able to detect that automatically. Surely you can't be the first with that problem.

@yousufinternet

This comment has been minimized.

yousufinternet commented Sep 27, 2016

I will do more research when I find time :)

I found some interesting things on this link

http://stackoverflow.com/questions/2258028/rtl-in-markdown

@pbek

This comment has been minimized.

Owner

pbek commented Sep 27, 2016

Thank you, but QTextBrowser doesn't support JavaScript... :/

Meanwhile there is the new release of QOwnNotes...

@pbek

This comment has been minimized.

Owner

pbek commented Sep 29, 2016

I will close this issue until there is more information.

@pbek pbek closed this Sep 29, 2016

@pbek pbek referenced this issue Sep 9, 2017

Closed

RTL editor text #714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment