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

内容解析 #480

Closed
gavinliu6 opened this issue May 11, 2018 · 8 comments
Closed

内容解析 #480

gavinliu6 opened this issue May 11, 2018 · 8 comments

Comments

@gavinliu6
Copy link

当我的文档内容是这样的时:
tim 20180511152648
浏览器就会报如下错误:
tim 20180511152853
@QingWei-Li

@gavinliu6
Copy link
Author

好像只在代码语言是php时才会这样

@dmed256
Copy link

dmed256 commented May 13, 2018

Can you add this to your index.html file?

    <script src="//unpkg.com/prismjs@1.13.0/components/prism-php.min.js"></script>

I got the same error when prism.js didn't recognize the language

@gavinliu6
Copy link
Author

gavinliu6 commented May 14, 2018

I did not understand what you mean, my index.html is like this:
<script src="//unpkg.com/prismjs/components/prism-php.js"></script>

@dmed256
Copy link

dmed256 commented May 14, 2018

🤔 hmm strange
I looked at it again and it fails when tokenizing ${foo} (called interpolation by marked)

error

I'm seeing language = undefined even though I have

| ```php
| $str = "{$a}";
| ```

I'll look into it a bit more

@dmed256
Copy link

dmed256 commented May 14, 2018

This works

| ```cpp
| $str = "{$a}";
| ```

Maybe because C++ doesn't have interpolating tokens

@gavinliu6
Copy link
Author

All right! If you solve the problem, please tell me. Thank you!

@dmed256
Copy link

dmed256 commented May 14, 2018

@gavinliu6 Can you try an older version of prismjs?

    <script src="//unpkg.com/prismjs@1.9.0/components/prism-php.min.js"></script>

Docsify comes with 1.9.0 and I think we're both picking up 1.13.0 which fails

@gavinliu6
Copy link
Author

Great, that works! Thank you very much for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants