Hard Breaks

by Börge Kiss
5
4
3
2
1
Score: 49/100

Description

Category: Note Enhancements

The Hard Breaks plugin has arrived, and it's all about giving you more control over your content formatting. With this nifty plugin, you can create a clear visual distinction between sections of text by inserting hard breaks, making your blog posts easier to scan and read. Whether you're writing tutorials, guides, or simply want to add some white space to your articles, Hard Breaks has got you covered.

Reviews

No reviews yet.

Stats

30
stars
7,158
downloads
2
forks
1,423
days
1,335
days
1,419
days
1
total PRs
0
open PRs
0
closed PRs
1
merged PRs
7
total issues
1
open issues
6
closed issues
0
commits

Latest Version

4 years ago

Changelog

Changes:

  • Implement a new approach to detect where hard line breaks are needed to fix a critical bug (issue #4). The plugin originally forces hard breaks all over the place, now it hand-picks only text in paragraphs and blockquotes that are located directly under the document root.

README file from

Github

Obsidian Hard Breaks Plugin

✅ Tested to work with the new major version (1.0.x) of Obsidian!

A plugin for Obsidian that adds an editor command to force hard line breaks (in contrast to soft line breaks) in the currently opened document. Hard line breaks are forced only in paragraphs of text and blockquotes! The plugin will not touch text in tables, links, lists, etc.

Obsidian Hard Breaks Plugin makes use of a set of robust Open-Source Markown parsing tools to guarantee it does what it's supposed to do.

Features

This plugin gives you ...

  1. ... an editor command that replaces all line breaks in the current document with hard line breaks (only in paragraphs of text and blockquotes, never in code blocks, front matter, etc.).
  2. ... an option in the settings to choose the format for the hard line breaks to use ( or \).

ℹ️ The formats for hard line breaks are specified in the CommonMark specification. It allows two whitespaces or a backslash at the end of a line. While the backslash is more visible in the Markdown source, it's less common and somewhat clutters your text. But it's a matter of taste...

screenshot of plugin settings

Do I need this plugin?

Maybe. Maybe not. If you already know the difference between soft and hard line breaks in Markdown, jump right to "Why automatic hard line breaks?" to understand the rationale of this plugin.

Long story short: If you...

  • ... need actual line breaks inside of paragraphs (e.g. for writing Poems...)
  • ... never intentionally use soft line breaks in Obsidian anyway (because why should you?)
  • ... don't want to type hard line breaks manually when you need them but still want portable Markdown documents

..., you might like this.

If you, for some reason, use soft line breaks (that only exist in editing, never in "Reading" mode or any other parsed and rendered version like HTML) a lot, this plugin may not be for you.

What are soft vs. hard line breaks?

In Markdown, a simple line break in the Markdown source is considered a soft line break. When parsing the Markdown to HTML, it will be parsed as a whitespace character or, again, a normal line break (which makes no difference in HTML). See this example:

foo
bar

... will be parsed to one of these (which are the same, because any spaces in HTML will be rendered as one single whitespace):

<p>foo bar</p>

<p>foo
bar</p>

For a common text flow with paragraphs, this is fine. But sometimes you need a line break without breaking the whole paragraph. This is what hard line breaks are for. In Markdown, hard line breaks are line breaks that are preceded by two whitespace characters ( ). See this example (select the text to see the whitespaces):

foo
bar

This will be parsed to:

<p>foo<br/>bar</p>

... with an actual line break.

Why force hard line breaks?

Why should one use soft line breaks at all? They don't make any difference in how the document is parsed/rendered. There is only one reason to use them (prove me wrong!): Manually wrapping paragraphs in Markdown source text. This might be desirable in an environment where long lines in the text flow aren't wrapped automatically (e.g. in a shell) or where the editor is so wide that the long lines become hard to read.

But Obsidian is not such an environment. It wraps text. The editor has a nice, reduced width. There is no need for soft line breaks in Obsidian.

Obsidian has a setting called "Strict line breaks". If you turn it off, Obsidian stops distinguishing soft and hard line breaks in "Reading" mode and displays anything as a hard line break. That's a nice feature for its convenience, but it's also a false view on your document as it doesn't follow the Markdown specification. Try giving the Haiku you wrote in Obsidian without using hard line breaks ...

An ancient pond!
With a sound from the water
Of the frog as it plunges in.

... to a friend who uses a software that strictly obeys the CommonMark specification. Your Haiku will look like this:

An ancient pond! With a sound from the water Of the frog as it plunges in.

You need hard line breaks in yout text to write actual Markdown in such cases. If you want a line break inside of a paragraph in Markdown, you have to use a hard line break. Otherwise your document isn't really portable to other Markdown platforms. But having to type two whitespaces (or a backslash) at the end of a line just to get a line break isn't ideal. Especially if you never need soft line breaks in flowing text anyway.

Installation

There are two ways:

  • Using Obsidians community plugin browser (recommended!)
  • Installing the plugin manually (why though?): Unpack the downloaded archive file into Obsidians plugin directory. Warning: You won't get automatic updates this way!

Thoughts on possible additional features

Automatic hard breaks while writing

The very first version of this plugin had a feature to automatically replace soft line breaks with hard line breaks while writing in the editor. This feature, although it was a nice idea, was removed due to the following reasons:

  • While writing, it's impossible to detect whether you are inside of a paragraph or an unfinished (non-closed) code block, front matter block or the like.
  • The Obsidian API doesn't offer the events needed to safely automate this operation: Editor changes won't work (see previous point), file changes won't work (Obsidian saves the file periodically, so this would change the document "under your fingers" while writing). Hopefully, this will change in the future. Would be nice to have!

Force line breaks in multiple documents

Another command that lets you force hard breaks not only in the current document, but in a selectable set of documents (a whole folder, the entire vault, etc.). This might very well be added in the future.

Development

First, install the dependencies with

npm i

Then, you can compile the plugin with:

npm run build

This will create a main.js file in the project root, which is the entry point of the plugin.

For testing it, the main.js and the manifest.json have to be placed in a .obsidian/plugins/hard-breaks/ folder (within your vault) to be picked up by Obsidian on the next start.

Acknowledgements

This plugin is based on the following projects:

Also, thanks to THeK3nger for the nice Obsidian plugin project template. It made things easier.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Advanced Copy
2 years ago by leschuster
An Obsidian plugin to copy Markdown and transform it into HTML, Anki, or any custom format. Create custom profiles with versatile templates tailored to your workflow.
Advanced Progress Bars
a year ago by cactuzhead
Obsidian plugin to create custom progress bars
Advanced Slides
3 years ago by MSzturc
Create markdown-based reveal.js presentations in Obsidian
AI Chat as Markdown
2 years ago by Charl P. Botha
Archivist Importer
3 months ago by Archivist AI
Import selected vault files into Archivist campaigns.
Arweave Uploader
2 years ago by makesimple
Asciidoc Reader
2 years ago by voidgrown
Obsidian plugin for reading AsciiDoc files
Attachments MD Indexer
a year ago by Ian Inkov
Converts Obsidian canvas files to markdown index files, making canvas content searchable and graph-viewable within Obsidian.
Auto Front Matter
3 years ago by conorzhong
Autocorrect Formatter
3 years ago by b-yp
A plugin running on Obsidian that utilizes autocorrect to format Markdown content.
Automatic Linker
a year ago by Kodai Nakamura
Avatar
3 years ago by froehlichA
An obsidian plugin for displaying an avatar image in front of your notes.
Awesome Flashcard
4 years ago by AwesomeDog
Handy Anki integration for Obsidian.
Better Markdown Links
2 years ago by mnaoumov
Obsidian plugin that adds support for angle bracket links and manages relative links properly
Blockquote Levels
4 years ago by Carlo Zottmann
A plugin for Obsidian (https://obsidian.md) that adds commands for increasing/decreasing the blockquote level of the current line or selection(s).
Callout Copy Buttons
a year ago by Aly Thobani
An Obsidian plugin that adds copy buttons to callout blocks in your notes.
CardBoard
5 years ago by roovo
An Obsidian plugin to make working with tasks a pleasure (hopefully anyway).
Chat clips
a year ago by sleepingraven
Record chat in ordinary markdown list.
ChatGPT MD
3 years ago by Bram Adams
A (nearly) seamless integration of ChatGPT into Obsidian.
Chronos Timeline
2 years ago by Claire Froelich
Render interactive timelines in your Obsidian notes from simple Markdown.
Confluence to Obsidian
3 years ago by K
import confluence space into obsidian
Console Markdown Plugin
3 years ago by Daniel Ellermann
An Obsidian plugin which renders console commands and their output.
Cooklang
2 years ago by Roger Veciana i Rovira
CookLang Editor
5 years ago by death_au/cooklang
Edit and display Cooklang recipes in Obsidian
Cooksync
a year ago by Cooksync
This is the official Obsidian plugin for Cooksync, maintained by the Cooksync team. It enables automatic import of recipe data from your Cooksync account. Note that this plugin requires a Cooksync account - a paid service that makes it easy to collect recipes from almost any recipe website.
Copy as HTML
4 years ago by Bailey Jennings
A simple plugin that copies the selected text to your clipboard as HTML
Copy as LaTeX
5 years ago by mo-seph
Quick plugin to be able to copy/paste from Obsidian/Markdown into a Latex document
Copy Section
2 years ago by skztr
Obsidian.md plugin adding a Copy button to the top of Headed sections
Creases
4 years ago by Liam Cain
👕 Tools for effectively folding markdown sections in Obsidian
Dataview Publisher
2 years ago by UD
Output markdown from your Dataview queries and keep them up to date. You can also be able to publish them.
Dataview Serializer
2 years ago by Sébastien Dubois
Obsidian plugin that gives you the power of Dataview, but generates Markdown, making it compatible with Obsidian Publish, and making the links appear on the Graph.
Dirtreeist
4 years ago by kasahala
Render a directory Structure Diagram from a markdown lists in codeblock.
Discord Message Formatter
3 years ago by Emile Durkheim
Obsidian.md plugin that lets you copy Discord conversations and perfectly formats them to Obsidian Markdown!
Docxer
2 years ago by Developer-Mike
🚀 Boost your productivity by previewing and converting Word files easily to markdown.
Emoji Shortcodes
5 years ago by phibr0
Emoji Shortcodes - Obsidian Plugin | Adds Support for Emoji Shortcodes to Obsidian
Enhanced Copy
2 years ago by Mara-Li
A obsidian plugin that allows to copy in markdown in reading view or canvas read-only view, creating profile and transform the text during copy.
Enhancing Mindmap
5 years ago by Mark
obsidian plugin editable mindmap,you can edit mindmap on markdown file
Enveloppe
4 years ago by Mara-Li
Enveloppe helps you to publish your notes on a GitHub repository from your Obsidian Vault, for free!
ExcaliBrain
4 years ago by Zsolt Viczian
A graph view to navigate your Obsidian vault
Excel to Markdown Table
4 years ago by Ganessh Kumar R P
An Obsidian plugin to paste data from Microsoft Excel, Google Sheets, Apple Numbers and LibreOffice Calc as Markdown tables in Obsidian editor.
Extended Markdown Syntax
a year ago by Kotaindah55
Extend your Markdown syntax using delimiters instead of HTML tags, such as underlining, superscript, subscript, highlighting, and spoiler.
Extract url content
5 years ago by Stephen Solka
Plugin to extract markdown out of urls
File Cleaner Redux
3 years ago by husjon
A plugin for Obsidian to help clean up files in your vault
File Include
3 years ago by Till Hoffmann
Filename Emoji Remover
4 years ago by Yüksel Tolun
A simple plugin for the note taking app Obsidian that will rename your files to remove emojis in their names.
Floccus Bookmarks to Markdown
3 years ago by mddevils
Foodiary
2 years ago by vkostyanetsky
Food tracker plugin for Obsidian
GH Links Shortener
8 months ago by David Barnett
Obsidian plugin to set shortened link text for pasted GitHub URLs
GitHub Sync
2 years ago by Kevin Chin
Sync Obsidian vault to personal GitHub
Global Markdown Encryption
3 years ago by shlemiel
a plugin for encrypting obsidian markdowns in-memory, single password based.
Heading Shifter
4 years ago by kasahala
Easily Shift and Change markdown headings.
Hexo Toolkit
2 years ago by Xiangru
An Obsidian plugin for maintaining Hexo posts.
Highlight Helper
3 years ago by Chongmyung Park
Helper to collect highlight in Obsidian
Horizontal Blocks
8 months ago by iCodeAlchemy
Bring Notion-style layouts to Obsidian — with side-by-side, resizable markdown blocks that support full Obsidian syntax including images, embeds, and internal links.
ii
2 years ago by Wilson
The main feature of this plugin is to quickly insert common Markdown code and HTML code, including Sup, Sub, Audio, Video, Iframe, Left-Center-Right Alignment, Variables, Footnotes, Callout, Anchor Points, HTML Comments and so on.
Image Captions
3 years ago by Alan Grainger
Add captions to images with inline Markdown and link support. The caption format is compatible with the CommonMark spec and other Markdown applications.
Image Upload Toolkit
3 years ago by Addo Zhang
An obsidian plugin for uploading local images embedded in markdown to remote store and export markdown for publishing to static site.
Immersive Translate
2 years ago by imfenghuang
Immersive Translate For Obsidian
Import GitHub Readme
2 years ago by Chasebank87
Insta TOC
2 years ago by Nick C.
Generate, update, and maintain a table of contents for your notes while typing in real time.
Interactive Code Blocks
2 years ago by Student Assistenten Team Deeltaken
Kanban
5 years ago by mgmeyers
Create markdown-backed Kanban boards in Obsidian.
Keyboard Formatter
10 months ago by Lauloque
Formats keyboard text (kbd) in your Obsidian notes quickly and consistently.
Limitless Lifelogs
a year ago by Maclean Dunkin
Sync your Limitless AI lifelog entries directly into Obsidian markdown files.
Links
3 years ago by MiiKey
manipulate & manage obisidian links
Linter
5 years ago by Victor Tao
An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
MagicCalendar
3 years ago by Vaccarini Lorenzo
An obsidian plugin that exploit a natural language processing engine to find potential events and sync them with iCalendar
Marjdown shortcuts
4 years ago by Jules Guesnon
🪨 Obsidian plugin that allows to write markdown from commands
Markdown Attributes
5 years ago by Jeremy Valentine
Add attributes to elements in Obsidian
Markdown Blogger
3 years ago by Alexa Fazio
Allows developers to push markdown notes to their local blog, portfolio, or static site. Works with Astro.js, Next.js, and any other framework configured to render markdown pages.
Markdown Calendar Generator
a year ago by Zach Russell
An intentionally simple obsidian markdown table calendar generator
Markdown Formatting Assistant
5 years ago by Reocin
This Plugin provides a simple WYSIWYG Editor for Markdown and in addition a command line interface. The command line interface facilitate a faster workflow.
Markdown Furigana
5 years ago by Steven Kraft
Simple Markdown to Furigana Rendering Plugin for Obsidian
Markdown Image Caption
3 years ago by Hananoshika Yomaru
Generate image caption easily. Completely markdown-based.
Markdown Link Space Encoder
3 years ago by Ron Kosova
Obsidian plugin to automatically encode spaces to %20 in Markdown-style links
Markdown prettifier
6 years ago by pelao
A markdown prettifier for obsidian
Markdown table checkboxes
3 years ago by DylanGiesberts
Obsidian plugin. Allows for the usage of checkboxes inside markdown tables.
Markdown Tags
2 years ago by John Smith III
Enhance your Markdown documents with custom tags. Use predefined or custom labels, customizable colors, and arrow indicators to visually track tasks and statuses.
Markdown Timeline
2 years ago by Jiaheng Zhang
An Obsidian plugin to record the events in a Flashback timeline
Markdown to Jira Converter
4 years ago by muckmuck
An obsidian.md plugin, which provides a markdown to jira markup converter
Markdown to Slack Message
3 years ago by Woongshik Choi
Markdown Tree
3 years ago by carvah
Introducing a powerful plugin that revolutionizes directory tree creation. With its intuitive Markdown-inspired coding style, this plugin empowers users to effortlessly and swiftly construct intricate directory trees.
Marker PDF to MD
2 years ago by L3N0X
Make use of different AI models to convert your pdfs into markdown with perfect ocr, latex formulas, tables, images and more! Supports Mistral AI OCR (free) and self hosted variants!
Markitdown File Converter
a year ago by Ethan Troy
Integrate Microsoft's Markitdown tool to convert various file formats to Markdown for your vault.
Marp
3 years ago by JichouP
Plugin to use Marp with Obsidian
mdx as md
5 years ago by Nikolay Kozhukharenko
Edit mdx files in Obsidian.md as if they were markdown
Meal Plan
2 years ago by Tyler Mayoff
A meal plan & recipe manager plugin for Obsidian
Mehrmaid
2 years ago by huterguier
Rendering Obsidian Markdown inside Mermaid diagrams.
Mind Map
6 years ago by James Lynch
An Obsidian plugin for displaying markdown notes as mind maps using Markmap.
Mochi Cards Exporter
5 years ago by kalbetre
Mochi Cards Exporter Plugin for Obsidian
Multi-Column Markdown
4 years ago by Cameron Robinson
A plugin for the Obsidian markdown note application, adding functionality to render markdown documents with multiple columns of text.
My Bible
2 years ago by GsLogimaker
Your own customization bible in your personal vault!
Note Linker with Previewer
2 years ago by Nick Allison
Obsidian Plugin to find and Link notes
Note Minimap
10 months ago by Yair Segel
Add a minimap to your Obsidian notes.
O2
3 years ago by haril song
Converts obsidian markdown syntax to other platforms.
Obsidian Clipper
4 years ago by John Christopher
Obsidian plugin that allows users to clip parts of a website into their obsidian daily note (or new note)
Obsidian GoLinks
4 years ago by David Brownman (@xavdid)
Turn go/links into clickable elements in Obsidian
Obsidian Handlebars Template Plugin
4 years ago by Sean Quinlan
This is a plugin for Obsidian adding support for the Handlebars template engine in Obsidian notes
Obsidian markdown export
4 years ago by bingryan
This plugin allows to export directory/single markdown to a folder. support output format(html/markdown/text)
OzanShare Publish
5 years ago by Ozan Tellioglu
This plugin allows you to publish your markdown notes with a single click directly from your Obsidian vault.
Paste Mode
5 years ago by Jacob Levernier
Obsidian Notes plugin for pasting text and blockquotes to the cursor's current level of indentation.
PDF Folder to Markdowns
a year ago by CrisHood
Convert a folder of PDFs into a folder of Markdown files with embedded PDFs. This plugin is useful for users who want to migrate their PDF notes from different apps (e.g., Boox) or organize their reference materials inside Obsidian.
Pickly PageBlend
3 years ago by Dmitrii Mitrichev
The easiest way to share your Obsidian notes
Postfix
3 years ago by Bhagya Nirmaan Silva (@bhagyas)
A postfix plugin for Obsidian
Prettier
2 years ago by GoodbyeNJN
PubScale
3 years ago by piriwata
An obsidian plugin for insert your note into a PlanetScale table
qmd as md
4 years ago by Daniel Borek
A plugin for Obsidian that enables editing and compiling `qmd` Quarto files.
Quadro
2 years ago by Chris Grieser (aka pseudometa)
Obsidian Plugin for social-scientific Qualitative Data Analysis (QDA). An open alternative to MAXQDA and atlas.ti, using Markdown to store data and research codes.
Quarto Exporter
2 years ago by Andreas Varotsis
Export Obsidian notes to Quarto-compatible QMD files.
Quiet Outline
4 years ago by the_tree
Improving experience of outline in Obsidian
Quoth
4 years ago by Eric Rykwalder
ReadItLater
5 years ago by Dominik Pieper
Reason
2 years ago by Joshua Pham
Digest your Obsidian notes
Recipe Grabber
3 years ago by seethroughdev
Recipe view
3 years ago by lachholden
View your Obsidian notes as interactive recipe cards while you cook.
Recursive Copy
2 years ago by datawitch
Remove HTML Tag
2 years ago by ChenPengyuan
Sheet Plus
2 years ago by ljcoder
obsidian spreadsheets solutions
Sheets Extended
3 years ago by NicoNekoru
Plugin that adds features to tables in obsidian including merging, vertical headers, and custom css
Simple Columns
a year ago by Josie
An Obsidian plugin that lets you create easily resizable and customizable columns in your notes.
Simple File Push
2 years ago by Kim Hudaya
Simple file push blog plugin
Simple Todo
2 years ago by elliotxx
A minimalist text-based todo manager (Text-Based GTD) for efficient task management in Obsidian.
Slackify Note
3 years ago by Jeremy Overman
SlashComplete
7 months ago by Spiderpig86
Notion-style Markdown autocompletion for Obsidian.
Slides Extended
2 years ago by Erin Schnabel (original: MSzturc)
Create markdown-based reveal.js presentations in Obsidian
Slurp
2 years ago by inhumantsar
Slurps webpages and saves them as clean, uncluttered Markdown. Think Pocket, but better.
Smart Export
3 months ago by Iván Sotillo
Plugin that follows wikilinks to a configurable depth, joining the notes into a single export.
Spoilers
2 years ago by Jacobtread
Spoiler blocks for Obsidian
Strip Internal Links
2 years ago by Adi Ron
A simple Obsidian plugin to strip internal links from files
Student Repo
a year ago by Feirong.zfr
学生知识库助手(Student Repository Helper)是一个面向学生或学生家长的Obsidian 插件,这款插件旨在解决学生在学习阶段面临的资料管理难题,将学习过程中产生的各类重要资料,如试卷、笔记、关键文档、绘画手工作品等,进行系统性的数字化整合与管理,并利用 AI 助手定期进行学习分析总结。随着时间的推移,它将助力你逐步搭建起一座专属你自己的知识宝库,这座宝库将伴随你一生,成为你知识成长与积累的见证。
Table Checkbox Renderer
7 months ago by Daniel Aguerrevere
Interactive checkboxes for Markdown tables in Obsidian. Toggle checkboxes in Reading Mode and instantly update your Markdown file. Supports multiple checkboxes per cell and any table layout.
Table Extended
5 years ago by AidenLx
Extend basic table in Obsidian with MultiMarkdown table syntax
Table Generator
4 years ago by Boninall
A plugin for generate markdown table quickly like Typora.
Table Line Break Mobile
4 months ago by marcelflymark
Obsidian plugin: Insert a new line break inside a table cell using the <br> HTML element
Task list
2 years ago by Ted Marozzi
A simple obsidian plugin enabling better task management via lists.
Title As Link Text
a year ago by Lex Toumbourou
An Obsidian plugin to set the Link Text using the document title
Tweet to Markdown
5 years ago by kbravh
An Obsidian.md plugin to save tweets as Markdown files.
WeWrite
a year ago by Learner Chen
Obsidian plugin to render note as WeChat MP article.
WhatsApp export note
a year ago by JoaoEmanuell
Obsidian plugin to export notes for whatsapp
Yesterday
2 years ago by Dominik Mayer
Obsidian plugin providing Yesterday journaling support