Skip to content
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

feat: convert numbered-list bullets #45

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea
# Logs
logs
*.log
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "logseq-schrodinger",
"version": "1.3.1",
"version": "1.3.2",
"description": "An awesome logseq plugin to export to Hugo Static sites and jumpstart your digital garden 🌱!",
"main": "dist/index.html",
"targets": {
Expand Down
6 changes: 5 additions & 1 deletion src/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ async function parseText(block: BlockEntity) {
// Experiment, no more lists, unless + or numbers
// (unless they're not)
if (logseq.settings.bulletHandling == "Convert Bullets") {
if (block.level > 1) {
// convert numbered-list bullets
if (text.includes("logseq.order-list-type:: number")) {
txtBefore = " ".repeat((block.level - 1) * 4) + "1. ";
text = text.replace("logseq.order-list-type:: number", "");
} else if (block.level > 1) {
txtBefore = " ".repeat((block.level - 1) * 2) + "+ ";
// txtBefore = "\n" + txtBefore
if (prevBlock.level === block.level) txtAfter = "";
Expand Down