Code Monkey home page Code Monkey logo

mybb-dvzcodetags's People

Contributors

dvz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

mybb-dvzcodetags's Issues

Code not rendering well after quick edit

After quick editing my post, the code blocks don't show lines, spaces, syntax highlighting or any info about the code. After refreshing the page it shows normally.

The error I got on console was:

Uncaught TypeError: Cannot read property 'children' of null
at prism-line-numbers.min.js:1
at Array.forEach ()
at m (prism-line-numbers.min.js:1)
at NodeList.forEach ()
at prism-line-numbers.min.js:1
DevTools failed to load SourceMap: Co

Two different blocks of code become equal

[code=p-code]
abc
[/code]

[code=p-code]
def
[/code]

When posting the above on my forum, I see both blocks of code containing "def". When editing, nothing is wrong in the source.

Limitation on code block count and code length.

As I've stated in MyBB's Discord, the right thing to be concerned is the length of a code block or the total length of code blocks in a page for performance when rendering by client side JS. And limiting the code block count is not ideal.

Turn to this page: https://community.mybb.com/thread-225028.html , the first code block has ~1.5k lines, which slows down the highlighting and makes browser freeze on mobile devices.

I read from code, there are two performance related limits:

  1. prismjs_code_formatter_heavy_count (via): currently 10 blocks. (maybe only 9 blocks are permitted before stopping rendering?)
  2. prismjs_code_formatter_heavy_length (via): currently 50000 lines.

I don't know if the length (2nd limit) is applied on each code block or all code blocks. Ideally, the latter one is preferred.

Take GitHub for example, it doesn't prevent any code from rendering by the number of code blocks or code length. Viewing large code pages in GitHub from mobile devices will possibly have freezing problems.

I don't think it's the site's fault for rendering the whole page of codes, but won't say the user has to bear this as well. A better way, IMO, to deal with it is either:

  • Simply set different limits for desktop and mobile devices, but it's difficult to maintain in future.
  • Carefully tune the limitation for both code block count & length (probably the code block count could be removed), and show a switch on current page for turning highlighting back on if the script decides to turn some feature off.

For me, the second one is better, I think.

Auto URL captures placeholder

https://mybb.com/
```php
phpinfo();
```

Produces:

<a href="https://mybb.com/%7B�DVZ_CT#0" target="_blank" rel="noopener" class="mycode_url">https://mybb.com/{DVZ_CT#0</a>}

Similar problem with:

https://mybb.com/`phpinfo()`

Font color

Want to change font color how I can i do it?
Tried from dvz code tag .css but font color not changing.
I'm using mybb 1.8.32 and roundo dark theme

it's a request not an issue

can't you make it compatible with php v 7.0? many ppl got the same version as me and can't just use it, so i hope you can make it as v 7.0.
thanks in advance !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.