Skip to content

remove default template leading spaces#12

Closed
strangepete wants to merge 1 commit intopyrmont:masterfrom
strangepete:template-spaces
Closed

remove default template leading spaces#12
strangepete wants to merge 1 commit intopyrmont:masterfrom
strangepete:template-spaces

Conversation

@strangepete
Copy link

Removes 2 leading spaces from the default template.

The spaces were coming through the output, and on github this caused sections following a list to be indented as though it were a multiline list item (I've read this is a markdown thing in general)

For example:

  • a janet

  • more janets

  • multi-

    ^ line
    ^ janets (there are 5 blank new lines preceding this, and just two spaces at the start of the line)


For example:
* a janet
* more janets
* multi-




  ^ line
  ^ janets  (there are 5 blank new lines preceding this, and just two spaces at the start of the line)

Seems odd that multiple zero-space blank lines will still trigger a multiline list item, but I saw people struggling with this back to 2013, and its new to me. But here we are :)

Removes 2 leading spaces from the default template.

The spaces were coming through the output, and on github this caused sections following a list to be indented as though it were a multiline list item (I've read this is a markdown thing in general)
@sogaiu
Copy link

sogaiu commented Dec 16, 2024

Hmm, I wonder what's going on here.

IIUC, I think the intent was for Janet's parser to trim the leading spaces because the item in question is a long-string.

Is it possible there is a Windows environment involved here? If so, it might have something to do with:

FWIW, a work-around I use on Windows sometimes is to put something like the following in .gitattributes:

*.janet text eol=lf
*.jdn text eol=lf
*.cgen text eol=lf

@strangepete
Copy link
Author

strangepete commented Dec 16, 2024

@sogaiu I think you're right! I just tested on linux (like I should have first) and none of the spaces make it through. On windows some sections retain the spaces, others sit flat

I'm unfamiliar with the .gitattributes though, does that go in the project directory or some global location? I had installed documentarian via jpm install (git url), do I have some influence over that compilation then?

Edit: I see .gitattributes just local. Maybe I should reopen the pull if it seems like multiline is a wont-fix in Janet

@strangepete
Copy link
Author

On second thought I am going to reopen this. The core issue is a wont-fix in Janet, so it would probably be good if this works multiplatform

@strangepete
Copy link
Author

closed while core issue is potentially resolved

@strangepete strangepete deleted the template-spaces branch February 23, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants