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

Bug to convert title with number format #58

Open
phan0041 opened this issue Aug 24, 2020 · 5 comments
Open

Bug to convert title with number format #58

phan0041 opened this issue Aug 24, 2020 · 5 comments

Comments

@phan0041
Copy link

phan0041 commented Aug 24, 2020

In file: gitdown/src/gitdown.js
Line 308 to 314

Source code:

// `test`
normalizedName = _.trim(marked(normalizedName));

// <p><code>test</code></p>
normalizedName = normalizedName.slice(3, -4);

// <code>test</code>

===

The conversion is incorrect if the title like this: 1. Title one
Raw markdown: ## 1. Title one
Expected raw output: ## 1.Title one
Expected user view: 1. Title one

Actual error result:

// `1. Title one`
normalizedName = _.trim(marked(normalizedName));

// <ol>\n<li>1. Title one</li>\n</ol>
normalizedName = normalizedName.slice(3, -4);

// >\n<li>Title one</li>\n<

===

@gajus gajus added the bug label Aug 24, 2020
@gajus
Copy link
Owner

gajus commented Aug 24, 2020

@phan0041 I read this a few times, but I am still not sure what the bug is.

It is always handy to have: what you tried to do, what you were expecting, and what happened instead.

Either way, I will fast track merging and releasing bug fixes if there are any.

@phan0041
Copy link
Author

phan0041 commented Aug 24, 2020

@gajus
Thank you for the reply.

What I tried to do: use gitdown.js to create a heading title with number like this: 1. Importing CDN Extension NuGet Package

What I put inside the source code:

## 1. Importing CDN Extension NuGet Package

What I expect:

## 1. Importing CDN Extension NuGet Package

The actual result:

## >
<li>Importing CDN Extension NuGet Package</li>
<

Sample file: https://github.com/Azure/portaldocs/blob/master/portal-sdk/generated/portalfx-pde-cdn.md

@gajus
Copy link
Owner

gajus commented Aug 24, 2020

@phan0041
Copy link
Author

The source file is located in the private repository of company (as a confidential information).
Only the generated file is shown to public.

To make a sample source file, you can put two lines of: ## 1. Importing CDN Extension NuGet Package
And run gitdown.js it will produce this error.
In the line 308 to 314 of file gitdown/src/gitdown.js, it does the incorrect conversion.

@gajus
Copy link
Owner

gajus commented Aug 25, 2020

Gotcha. Well, if you end up working on a failing test case/ fix, I will prioritize addressing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants