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

Rendering partial inside a highlightjs block #21

Open
MohammadYounes opened this issue Aug 21, 2014 · 6 comments
Open

Rendering partial inside a highlightjs block #21

MohammadYounes opened this issue Aug 21, 2014 · 6 comments
Labels

Comments

@MohammadYounes
Copy link

I have a code snippet that I want to reuse across multiple pages, I created a partial and when I tried to render it along other code inside a highlightjs code block I received the following error :

error: An error occured:
TypeError: Cannot read property 'task' of undefined

Note: Moving the partial call outside hljs code block works fine.

page.html.eco

<pre>
<code class="lang-javascript">
function sample(){ 
}

<%- @partial('snippet') %>

function example(){ 
}

</code> 
</pre>

snippet.html.eco

function common(){

}

environment

docpad --version
v6.69.0

node --version
v0.10.26

npm --version
v1.4.3

OS
Windows 7 Enterprise x64

@balupton balupton changed the title Rendering partial inside a highlightjs block Rendering partial inside a highlightjs block Aug 22, 2014
@balupton
Copy link
Member

Strange.

Can you provide the code of that produced the error rather than just the code that produced the fix? That'll help.

Alternatively, if you could do up a mini test project to showcase the problem, I'll be able to fix this pretty quickly. Seems like it is something on our end that was exposed with the specific setup.

@MohammadYounes
Copy link
Author

The code I provided is the one causing the error

@MohammadYounes
Copy link
Author

Find sample project here, I used html5-boilerplate.docpad, added one partial snippet.html.eco and modified index.html.eco to render it inside hljs block.

@derberg
Copy link

derberg commented Mar 4, 2015

I'm using docpad 6.63.3 and also have the same issue, partial in pre/code fails with exactly the same issue. @MohammadYounes did you solved it somehow?

@MohammadYounes
Copy link
Author

@derberg Nop! I moved on without using it.

@derberg
Copy link

derberg commented Mar 4, 2015

ok, so for now as a workaround I'm using <code class="nohighlight"> to disable highlight plugin to process my code snippet so no errors.
Hope some smart guy can look at it and solve it

@mikeumus mikeumus added the bug label Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants