azu / gitbook-plugin-include-codeblock

GitBook plugin for including file
Other
40 stars 25 forks source link

Code title displayed in HTML #18

Closed gdolle closed 8 years ago

gdolle commented 8 years ago

Hi @azu,

It seems that currently in Gitbook, the parser displays the html code in the title (see generateEmbedCode )

for example, we see this <a name="test.js" href="fixtures/test.js">test.js</a> instead of [test.js](fixtures/test.js).

It looks like a bug right ?

gdolle commented 8 years ago

I think that it might be a good idea to make the title optional in the future.

For example:


[example]()

// source code


[file.js]()

// source code

What do you think ? (If you're ok, I open a specific issue)

azu commented 8 years ago

@gdolle

we see this <a name="test.js" href="fixtures/test.js">test.js</a> instead of [test.js](fixtures/test.js).

It is expected behavitor. At first, the motivation of <a name> is used for anker link.( <a href="#test.js">Anker Link</a>. Markdown have not the same feature of name)

If we introduced pluginsConfig like "embed-template", this issue and #7 will be resolved, I think.


make the title optional in the future. -- https://github.com/azu/gitbook-plugin-include-codeblock/issues/18#issuecomment-216904422

title: command/attribute? is good idea.

What do you think ? (If you're ok, I open a specific issue)

Ok. It will be separated issue.

gdolle commented 8 years ago

It is expected behavitor. At first, the motivation of is used for anker link.( <a href="#test.js">Anker Link</a>. Markdown have not the same feature of name)

@azu Ok. After a second check, it seems that the problem comes from the asciidoc format that does not display properly the html code. In markdown everything is ok.