Closed MX-Qulin closed 4 years ago
Uncaught Error: Call to undefined function Highlight\mb_strlen() in /home/judge/src/web/light/Highlight/RegEx.php:99
This means that the mbstring
extension for PHP is not enabled. Depending on your server, you will probably need to install/enable it. Typically on most Linux systems, you can install it through your package manager; e.g. there's a php-mbstring
package for Debian.
Also, the demo.php
file takes 9 minutes for me to fully load (it is going through 34,225 iterations of highlighting). I'd recommend looking at example.php
or line-numbers.php
if you just want to see the highlighting in action. If you want to see all 185 languages highlighted, then I'd recommend the compare.php
file, which loads relatively faster compared to demo.php
.
emmmmm... It look likes that your server is better than me:) Anyway, Thankyou for helping me.
Well, i'd like to know if there's a feature that can show LineNumbers beside the code. You know, it helps a lot for us to read and explain code. If there's no this feathre, Would you please add it and then inform me? Thank you:)
The official way to add line numbers in this project is to use HighlightUtilities\splitCodeIntoArray()
. You can see its sample usage in demo/line-numbers.php.
Thank you very much!
Anyway,I've found some other problem... The model seems not able to render the normal characters. Please take a look at my screenshot.(the two below is same. Placeing them is bacause Github's pic maybe slow or unable to open) my screenshot Thank you:)
i use the css that is linked https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/styles/school-book.min.css
Moving forward, if you could please create separate issues for these separate problems/questions, that'd help anyone in the future find relevant discussions.
In fact, I'm going to close this specific issue, so could you please create a new issue with the following information?
All of this would help me replicate the problem. Since I can't gather much from the screenshot.
Maybe there're some bugs in the demo(i didn't use composer) When i ran demo.php, it shows 504 and the CPU dashed to 98%. Then i use php demo.php and it says
Can you explain why this happen or fix it? Hope to hear from you.