-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Fix] parseMarkdown startDelimiter #24
base: master
Are you sure you want to change the base?
Conversation
I have found other issues related to Windows 10 :
Because Unibit works great on Linux, I'll continue to use it in the right way. Thank you for sharing this library, it's very useful and working well (on real OS) ! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 49108ea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NicolasRoehm thanks for the PR.
Good catch with the EOL
.
Regarding path.sep
, please see comments inline
let pageUrl = _.trim(_.get(page, 'url'), path.sep); | ||
pageUrl = prettyUrl(pageUrl); | ||
const pageUrlParts = _.split(pageUrl, '/'); | ||
const pageUrlParts = _.split(pageUrl, path.sep); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are handling page URL paths. URLs always use forward slash disregards to the underlying system /
.
On windows system, the path.sep
will be \
so the logic will not work for URL paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the path.sep
is not about URL but rather about file routing/parsing.
On windows system, the page.url
value prints \\blog\\author\\dianne-ameter
.
- When we try to remove the leading and trailing
/
character(s) with_.trim
, nothing happens :pageUrl
contains\\blog\\author\\dianne-ameter
instead ofblog\\author\\dianne-ameter
.
- Then we split the url parts by the hardcoded
/
, so we get :pageUrlParts = [ '\\blog\\author\\dianne-ameter' ]
instead of['blog', 'author', 'dianne-ameter']
.
This causes the blog page to not list any blog posts and all subdirectory routes are skipped/broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting,
Then I guess the root cause of this bug is somewhere before the execution of this code.
The page.url
should never have OS specific separators and should always have standard URL forward slash - /
.
Maybe the code that constructs the original url
property?
I was not able to build the pages on Windows 10 using
unibit build
orunibit develop
.It always outputs
[Unibit] Generating 0 pages...
I removed the
\n
on each startDelimiter and it now works.Surprisingly, endDelimiter works fine as is, for example,
\n---
.