-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Feature Request] Interpolation Expression in code block (Allow no v-pre at code block) #413
Comments
Good point. Currently, the We could add some extra config to disable it |
Can you provide the component |
@ulivz He means the ```
|
@fago Currently, you can use
---update After d0ef06f, you have to use it like:
See #422 |
Please don't measure a problem as I think it is. and please give a solution after the problem is clear, otherwise it will bring a lot of noise. |
@ulivz Alright, alright. I'll notice my words. I removed that "I think". What he said is:
So that is ``` |
sry for the delay here. As discussed, yes I've been referring to markdown code formatting, thus
I was not aware of the |
@meteorlxy this does not get the job done.
I would like to have syntax highlighting. How do I perform that then? :/ Having the option to remove
|
I recommend a better choice:
|
I haven't worked on vuepress for about two months, maybe there are some new features that make the workaround fails. Syntax highlighting currently conflicts with vue's interpolation, because of the markdown parsing workflow of vuepress. See https://github.com/vuejs/vuepress/pull/415/files#diff-9780d43a67a5ff4083a22bab7ae331a8R107. |
I see. Keep on with the good work anyway @meteorlxy :) You are a great contributor :D |
Sorry for the delay, there are some reasons for shelving #415:
ConclusionThus, the reasonable workaround at the moment is that when user uses interpolation in a language code block where the interpolation expression would be corrupted by highlighting, our build process should not highlight its code by default, or user might receive strange errors. And for highlighting code at runtime, I suggest to create a plugin for it since most of users will not have the requirement of highlighting dynamic code. |
Actually I think VuePress shouldn't handle such edge-scene requirements, so I recommended that you to create a plugin for it. it would be easy to get it by taking advantage of the effort of #415. |
vuepress adds a `v:pre` tag to a fenced code block, which escapes any vue interpolation so you see the full, unaffected code. this interferes with instances where you need the vue interpolation for the code to make sense. I updated an escaped code block to use the same style as a block earlier in the snippet so that interpolation works. see vuejs/vuepress#413
vuepress adds a `v:pre` tag to a fenced code block, which escapes any vue interpolation so you see the full, unaffected code. this interferes with instances where you need the vue interpolation for the code to make sense. I updated an escaped code block to use the same style as a block earlier in the snippet so that interpolation works. see vuejs/vuepress#413 Signed-off-by: zachmandeville <webmaster@coolguy.website>
vuepress adds a `v:pre` tag to a fenced code block, which escapes any vue interpolation so you see the full, unaffected code. this interferes with instances where you need the vue interpolation for the code to make sense. I updated an escaped code block to use the same style as a block earlier in the snippet so that interpolation works. see vuejs/vuepress#413 Signed-off-by: zachmandeville <webmaster@coolguy.website>
I'm using vue press 0.8.4 for technical docs and generally works great, thanks a lot for the great project!
However, we'd like to use variable expansion in markdown code. Example, a code block like
would show
cd ~/projects/{{ $project }}/vcs/
although the variable $project is registered. It works correctly when markdown code formatting is not used.Is there a way to make variable expansion / vue processing of markdown processed html work?
This feature would allow the technical docs to use replacement patterns where meaningful, so any changes to those docs can be done easily by changing the variables.
The text was updated successfully, but these errors were encountered: