Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"MD013": {
"line_length": 70,
"heading_line_length": 70,
"code_block_line_length": 9999
},
"MD025": {
"front_matter_title": ""
}
}
18 changes: 18 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"printWidth": 70,
"proseWrap": "always",
"overrides": [
{
"files": "*.md",
"options": {
"printWidth": 70,
"proseWrap": "always",
"endOfLine": "lf"
}
}
],
"plugins": [
"./.scripts/prettier-plugin-strip-nbsp.js"
],
"endOfLine": "lf"
}
32 changes: 32 additions & 0 deletions .scripts/prettier-plugin-strip-nbsp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Prettier plugin to strip trailing non-breaking spaces from markdown files
const markdown = require('prettier/parser-markdown');

module.exports = {
parsers: {
markdown: {
...markdown.parsers.markdown,
parse(text, parsers, options) {
// Remove trailing non-breaking spaces (U+00A0) and other Unicode whitespace at end of lines
// This handles both lines that end with non-breaking spaces and lines that are entirely non-breaking spaces
let cleaned = text
// Remove trailing Unicode whitespace (non-breaking spaces, etc.) at end of lines
.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000]+$/gm, '')
// Also remove lines that are entirely Unicode whitespace (non-breaking spaces)
.replace(/^[\u00A0\u2000-\u200B\u202F\u205F\u3000]+\n/gm, '\n');

// Convert leading non-breaking spaces to regular spaces
// This fixes formatting issues where NBSP at the start of lines prevents proper paragraph/list formatting
cleaned = cleaned.replace(/^([\u00A0\u2000-\u200B\u202F\u205F\u3000]+)/gm, (match) => ' '.repeat(match.length));

// Convert non-breaking spaces before markdown list markers to regular spaces
// This fixes formatting issues where NBSP prevents proper list item recognition
cleaned = cleaned.replace(/([\s]*)[\u00A0\u2000-\u200B\u202F\u205F\u3000]+([-*+]\s)/gm, '$1$2');

// Use the original markdown parser
return markdown.parsers.markdown.parse(cleaned, parsers, options);
},
},
},
printers: markdown.printers,
languages: markdown.languages,
};
8 changes: 5 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"makefile.configureOnOpen": false
"makefile.configureOnOpen": false,
"files.trimTrailingWhitespace": true,
"[markdown]": {
"files.trimTrailingWhitespace": false
}
}


Loading