jsdoc2md / dmd

The default output template for jsdoc2md
MIT License
39 stars 49 forks source link

Escape underscores in markdown #59

Closed martijnversluis closed 6 years ago

martijnversluis commented 6 years ago

Currently, idenfitiers containing underscores are rendered incorrectly: words enclosed by underscores get an italic font style. Underscores should be escaped to prevent this issue.

An example from a generated list of constants:

image

When escaping underscores it renders correctly:

image

75lb commented 6 years ago

thanks, looking into it now.. where are you seeing this issue? It's not an issue on Github..

75lb commented 6 years ago

Could you also post some code which exercises your change please?

I have applied your patch on a branch and I'm using this input code, but I'm not seeing the intended escaping in the output.

/**
 * a global const
 */
const global_const_underscore = 'something'

Output using your patch:

<a name="global_const_underscore"></a>

## global_const_underscore
a global const

**Kind**: global constant  
martijnversluis commented 6 years ago

@75lb Sorry, I thought I'd seen the helper being already used, but it is not. I changed the sig-name.hbs template to use the escape helper for names.

It returns the following markdown:

<a name="START_OF_CHORUS"></a>

## START\_OF\_CHORUS : <code>string</code>
Start of chorus directive. See https://www.chordpro.org/chordpro/Directives-env_chorus.html

**Kind**: global constant  
75lb commented 6 years ago

Thanks mate. 👍

Released in dmd 3.0.13, please reinstall your jsdoc-to-markdown to pick up the change.

martijnversluis commented 6 years ago

@75lb Thanks for the quick release, my docs are generated correctly with 3.0.13