X Tutup
Skip to content

fix(markdown-legacy): normalize some characters for kramed's annotate function#88

Merged
azu merged 5 commits intohonkit:masterfrom
solufa:fix/autocrlf
Jul 5, 2020
Merged

fix(markdown-legacy): normalize some characters for kramed's annotate function#88
azu merged 5 commits intohonkit:masterfrom
solufa:fix/autocrlf

Conversation

@solufa
Copy link
Contributor

@solufa solufa commented Jul 4, 2020

// annotate.blocks does not normalize src, so windows fail the reason
const normalizedSource = src.replace(/\r\n|\r/g, "\n");
var lexed = annotate.blocks(normalizedSource);
var lexed = annotate.blocks(src);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can not require that user should not use CRLF.
So, Its needed in parser.

I think that this is a bug of kramed.
kramed does same normalize in lexer.
https://github.com/GitbookIO/kramed/blob/9d96b7ac9e063b94d51423d8cd450f4a7c7eb1f3/lib/lex/block.js#L50-L58
But, kramed's annotate function does not it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 I've noticed that we need to add other normalize into this line OR fork kramed.

@azu
Copy link
Member

azu commented Jul 4, 2020

Thanks PR. I've commented

steps:
- name: Disable autocrlf
run: git config --global core.autocrlf false
if: matrix.os == 'windows-latest'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this?
We want to use default config.

@solufa solufa changed the title fix(ci): disable autocrlf on Windows fix(markdown-legacy): normalize some characters for kramed's annotate function Jul 5, 2020
@solufa
Copy link
Contributor Author

solufa commented Jul 5, 2020

Thanks for the comments.
I didn't pay enough attention to users.

Sorry for the many commits.
I can rebase it if necessary.

@azu azu merged commit 29424f3 into honkit:master Jul 5, 2020
@azu
Copy link
Member

azu commented Jul 5, 2020

@solufa No problem! Thanks for PR

@solufa solufa deleted the fix/autocrlf branch July 5, 2020 01:36
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

X Tutup