Giter Site home page Giter Site logo

Comments (5)

modatwork avatar modatwork commented on July 27, 2024 1

<br> should work. But I found that my case is a little special. The newline begins with 4 spaces. And Obsidian can't render that correctly without a > in each line.

from obsidian-apple-books-highlights-plugin.

bandantonio avatar bandantonio commented on July 27, 2024 1

<br> should work. But I found that my case is a little special. The newline begins with 4 spaces. And Obsidian can't render that correctly without a > in each line.

The actual number of spaces is not an issue (however, fun fact, almost all of my highlights have 2 spaces indents, even those taken from bullet points 🤔). Anyway, it seems like I managed to workaround the bug by sacrificing newlines.
So, for example, the rendered highlight from your example will look like that:

> [!QUOTE]
>  Chapter 1 introduces the terminology and approach
that we’re going to use throughout this book. It examines what we actually mean by
words like reliability, scalability, and maintainability, and how
we can try to achieve these goals.

from obsidian-apple-books-highlights-plugin.

bandantonio avatar bandantonio commented on July 27, 2024

@modatwork Thank you for the feedback and submitting the report. Recently, I stumbled upon a similar behavior with regular highlights, so it's time to fix it 🙃

from obsidian-apple-books-highlights-plugin.

bandantonio avatar bandantonio commented on July 27, 2024

@modatwork I spent some time with this bug and basically, there are two options available:

1 - preserve newlines. The only reasonable way for this option to work (at least, with the current tooling) is to add a tiny bit of HTML to the resulting Markdown file, like this:

Rendered Markdown file:

> [!QUOTE]
>  Lorem ipsum dolor sit amet, consectetur adipiscing elit.<br>
Sed non risus.
Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat.

Preview:

2 - remove newlines. Still an option, the only minor issue is a slight decrease of readability

> [!QUOTE]
>  Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Sed non risus.
Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat.

What option you like more? Personally, I feel like adding a tiny bit of HTML won't hurt, as many people use HTML snippets in their Obsidian vaults as well. Plus it will preserve the original structure and won't impact readability.

from obsidian-apple-books-highlights-plugin.

modatwork avatar modatwork commented on July 27, 2024

Another option is to add an {{#each}}{{/each}} syntax for each line of the highlight text. I'm not sure if that's a good idea to add this complexity.

from obsidian-apple-books-highlights-plugin.

Related Issues (16)

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.