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

About line breaks #634

Closed
vanleo2001 opened this Issue Jul 16, 2017 · 13 comments

Comments

Projects
None yet
2 participants
@vanleo2001

vanleo2001 commented Jul 16, 2017

Can you add “GFM line breaks” option in preview?

I know that is two break lines as new line in standard markdown syntax. Also I know One break line could be as a new line in GFM ( Github-flavored Markdown ). Can you add this option to do it in preview?

multilines break with "paste html and media"

When I paste html content with shoutcut "ctrl-shift-v", I can find many break lines more than two. As you know, multi break lines just as ONE NEW LINE. So can you tidy them?

@pbek pbek added the enhancement label Jul 16, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 16, 2017

Can you add “GFM line breaks” option in preview?

markdown to html conversion is done by an external library, I haven't found a way to do this yet

multilines break with "paste html and media"

I'll take a look

@pbek

This comment has been minimized.

Owner

pbek commented Jul 23, 2017

17.07.6

  • replacing multiple line breaks when pasting html into a note with Ctrl + Shift + V

@pbek pbek added this to the 17.07.6 milestone Jul 23, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 23, 2017

There now is a new release, could you please test it and report if it works for you?

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 23, 2017

Tell the truth, I am not satisfied with the new version.
The test url is https://www.yahoo.com/gma/sean-spicer-resigns-white-house-press-secretary-164505561--abc-news-topstories.html

The "paste the html or media" function in QON is
snap620

The same function in atom with "atom-to-markdown" plugin is
snap619
It is what I expect.

@pbek

This comment has been minimized.

Owner

pbek commented Jul 23, 2017

Maybe you should have posted an example before and specify more clearly what you expected. ;)

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 23, 2017

Below is the origin html in browser.
snap625

I expect the note preview is just as same as shown in browser , and the note text is readable and tidy. You can see the line breaks are cleaned up in QON
snap624

@pbek

This comment has been minimized.

Owner

pbek commented Jul 23, 2017

You have great ambitions. Do you care to lay hands on the sourcecode of QOwnNotes? I would assist you.

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 23, 2017

Yes, please!

@pbek

This comment has been minimized.

Owner

pbek commented Jul 23, 2017

Great! You can play around with the html to markdown converting in src/utils/misc.cpp,
see: 02a2f8a

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 23, 2017

in src/utils/misc.cpp

QString Utils::Misc::htmlToMarkdown(QString text)

add code?

text.replace(QRegularExpression(
            "<p.*?>(.+?)</p>",
            QRegularExpression::CaseInsensitiveOption), "\n\n\\1\n\n");
@pbek

This comment has been minimized.

Owner

pbek commented Jul 24, 2017

looking good, if you want to make a pull request (to get the recognition for your contribution) please do so
see: https://help.github.com/articles/creating-a-pull-request/

@pbek pbek modified the milestones: 17.07.7, 17.07.6 Jul 26, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 26, 2017

I added it now myself.

17.07.7

@pbek

This comment has been minimized.

Owner

pbek commented Jul 26, 2017

There now is a new release, could you please test it and report if it works for you?

@pbek pbek closed this Jul 28, 2017

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