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

Embed files does not work #1005

Closed
1 task
gigaga opened this issue Jan 15, 2020 · 13 comments · Fixed by #1598
Closed
1 task

Embed files does not work #1005

gigaga opened this issue Jan 15, 2020 · 13 comments · Fixed by #1598
Labels
bug confirmed as a bug help wanted

Comments

@gigaga
Copy link

gigaga commented Jan 15, 2020

Bug Report

By using the last release of docsify (from CDN https://cdn.jsdelivr.net/npm/docsify@4), the feature Embed files does not work.

Steps to reproduce

From the code below :

[filename](./test.md ":include")

What is current behaviour

The render will be a link name filename.

What is the expected behaviour

The test.md content should be rendered directly (embedded).

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: Windows

  • Node.js version: v10.15.3

  • npm/yarn version: npm 6.4.1

  • Browser version: Chrome

  • Docsify version: 4.4.0

  • Docsify plugins: tried without any plugins, but I have the same issue

@anikethsaha
Copy link
Member

is it same for prev version ?

@gigaga
Copy link
Author

gigaga commented Jan 15, 2020

I tried with :

:(

@anikethsaha
Copy link
Member

thanks, I will check it soon 👍

@anikethsaha anikethsaha added bug confirmed as a bug help wanted labels Jan 15, 2020
@gigaga
Copy link
Author

gigaga commented Jan 15, 2020

Also, from @4.8.0, embed file feature works, however, from a specific plugin, I'd like to change content so, from

$docsify.plugins = [].concat(install, $docsify.plugins);

// Install a specific plugin to force current sidebar item active into collapse state
function install(hook, vm) {
 hook.beforeEach(function(content) {
   // Invoked each time before parsing the Markdown file.
   // ...
   console.log(content)
   return content;
 });
}

content is only the content of main MD file. I'm not able to change content of an embed file :(.

Thanks a lot for your feedback!

@anikethsaha
Copy link
Member

Yes it can't read the embedded file's code

@gigaga
Copy link
Author

gigaga commented Jan 15, 2020

No workaround is possible?
Thanks

@anikethsaha
Copy link
Member

i cant say that right now, I need to check and try.
I am not sure how markedjs process embedded files that's why.
Feel free to investigate 👍

@stratosgear
Copy link

stratosgear commented Jan 15, 2020

what a coincidence! I just got hit by it right now!

Try with single quotes, like in: [filename](./test.md ':include').

Works for me!

@anikethsaha
Copy link
Member

what a coincidence! I just got hit by it right now!

Try with single quotes, like in: [filename](./test.md ':include').

Works for me!

@gigaga can you try this

@gigaga
Copy link
Author

gigaga commented Jan 16, 2020

Hello @anikethsaha

Like you, it's work by using single quotes!

Thanks!

@gigaga
Copy link
Author

gigaga commented Jan 16, 2020

About embedded files processing, I can do what I want by override markdown function.

Thanks again :)

@anikethsaha
Copy link
Member

Yea you can use the plugin hook to get into the core op.

@trusktr
Copy link
Member

trusktr commented Jun 25, 2021

Will be fixed by #1598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed as a bug help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants