Code Monkey home page Code Monkey logo

Comments (6)

zoni avatar zoni commented on May 25, 2024 2

Happy new year! v22.1.0 is out now with a new --hard-linebreaks CLI argument. It appears to work as intended on my basic, exploratory testing, but please feel free to let me know if you run into unexpected issues on a real vault.

from obsidian-export.

zoni avatar zoni commented on May 25, 2024

Hey @ih8snow,

I suspect you have the option Strict line breaks (found under the Editor options setting) turned off in your Obsidian settings, is that right?

Strictly speaking, Markdown/CommonMark, ignores linebreaks. That is, the following text is rendered as a single sentence:

This is a line
which is split across multiple lines
in markdown source text.

If you want insert hard linebreaks here, there's two ways you can do this with Markdown. The first option is to append two blank spaces ( ) at the end of the lines:

This is a line  
which is split across multiple lines  
in markdown source text.

The other option, which I personally prefer and recommend, is to add a backslash at the end of the line:

This is a line \
which is split across multiple lines \
in markdown source text.

Does that help?

from obsidian-export.

zoni avatar zoni commented on May 25, 2024

Some more good news. 😄 I took a look at the information provided by the underlying parser, and it turns out it emits SoftBreak events for these soft linebreaks in your original example.

I'm able to use this information to turn these SoftBreaks into HardBreaks, which should mimic Obsidian's Strict line breaks option. With all of the postprocessor infrastructure I introduced in v0.7.0 (2021-04-11) this is quite trivial to implement now and I already have a working proof of concept implementation.

I just need to organize this new code properly, hook it up to a CLI argument, add some testcases, etc. so expect a new feature and release with this somewhere over the next week or so.

from obsidian-export.

ih8snow avatar ih8snow commented on May 25, 2024

I suspect you have the option Strict line breaks (found under the Editor options setting) turned off in your Obsidian settings, is that right?

Hi,
you are correct. I'm using these settings. Thanks for your explanation, that definitely helps. I was not really sure what these settings will cause in the work with obsidian, but now I can see it more clear.

from obsidian-export.

ih8snow avatar ih8snow commented on May 25, 2024

I'm able to use this information to turn these SoftBreaks into HardBreaks, which should mimic Obsidian's Strict line breaks option.

That is super cool! Great news at the end of the year.
I'll test with the above-mentioned settings and of course wait for the new version.
Many thanks for your support!

from obsidian-export.

ih8snow avatar ih8snow commented on May 25, 2024

Thanks!!!
Works perfect!

from obsidian-export.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.