| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| [ ! ] Code Synthax | |
|---|---|
| Tweet Topic Started: Jan 14 2015, 12:19 AM (1,172 Views) | |
| Kankuro | Jan 14 2015, 12:19 AM Post #1 |
|
かんくろ
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Test board Zeta Can anybody create or direct me to a code that will correctly add Synthax to the [code] BBcode? Like how you can do it with [html] but I want this for JQuery, Javascript, CSS, Lua, C+, C++, Python, Java, MySQL, and PHP If it helps any here are sources for code Synthax. http://prismjs.com/ https://highlightjs.org/ https://code.google.com/p/google-code-prettify/ Edited by Kankuro, Jan 14 2015, 11:18 PM.
|
![]() |
|
| Viral | Jan 17 2015, 03:28 PM Post #2 |
![]()
Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
For someone who has time to do this, prismjs is a good option (I've used it before). One option would be to use xanikseo's bbcode to convert `[code=js]..[/code]` to the `<code class="language-js">..</code>` or whatever it should be.
Edited by Viral, Jan 17 2015, 03:29 PM.
|
![]() |
|
| Kankuro | Jan 17 2015, 03:32 PM Post #3 |
|
かんくろ
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
The main languages I want are the web design languages (MySQL, PHP, CSS, JavaScript, JQuery, etc) and the most popular programming ones like C+, Python, Java, and C# |
![]() |
|
| Cory | Jan 28 2015, 03:17 PM Post #4 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Well, I got the code to work for the most part, only there's a problem: http://i.imgur.com/I67HO7I.png The span elements make everything display inline and there's not really a CSS value for 'display' that produces a normal effect for the text that I'm aware of. |
![]() |
|
| Kankuro | Jan 28 2015, 07:56 PM Post #5 |
|
かんくろ
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Looks good, unfortunately I can't really help, you're smarter than me lol. Maybe Viral can suggest something. |
![]() |
|
| Cory | Jan 30 2015, 09:40 PM Post #6 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Hopefully someone will figure out the issue, otherwise it's unfortunate such a cool code can't be used due to a silly minor CSS issue it seemed the provider of the code would have fixed. You could always try contacting the webmaster of that webpage if no one pulls through. I'm clueless myself. |
![]() |
|
| Kankuro | Jan 30 2015, 11:25 PM Post #7 |
|
かんくろ
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I can try to ask a few knowledgeable coders I know. Only issue is that they wouldn't know anything about Zetaboards. However they will know CSS, JS, PHP, MySQL, etc. If this can be fixed without knowledge of ZB then I'll ask. |
![]() |
|
| Cory | Feb 4 2015, 02:53 PM Post #8 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
They don't have to know anything about ZetaBoards to fix this issue. It's a CSS issue. |
![]() |
|
| Kankuro | Feb 4 2015, 05:38 PM Post #9 |
|
かんくろ
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Would you mind posting the full coding so I can provide it to them? |
![]() |
|
| Cory | Feb 4 2015, 08:26 PM Post #10 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
<head>:<body>:
|
![]() |
|
| RedBldSandman | Feb 7 2015, 02:09 AM Post #11 |
![]()
Asante sana Squash banana
![]() ![]() ![]() ![]() ![]() ![]()
|
JavaScripts:Below the Board: This is a really dirty way of sorting out the problem but I don't have time to come up with a more elegant solution so have just used Cory's code and added bits to fix the problem. The problem isn't a CSS problem. It is caused by Prism stripping html from the code element before doing the syntax highlighting thereby removing all the linebreak elements (<br/>). This solution converts the linebreak elements into text and then converts them back at the end of the syntax highlighting. This approach could cause problems in some codes but this should be pretty rare. If it causes problems regularly then a new solution will need to be devised. |
![]() |
|
| Kankuro | Feb 7 2015, 11:30 AM Post #12 |
|
かんくろ
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Your "solution" seems to have made it worse... http://prntscr.com/626jfp EDIT: Also the only ones that got colored were CSS and PHP Edited by Kankuro, Feb 7 2015, 11:51 AM.
|
![]() |
|
| RedBldSandman | Feb 7 2015, 02:41 PM Post #13 |
![]()
Asante sana Squash banana
![]() ![]() ![]() ![]() ![]() ![]()
|
Just checked on other languages (I only tested it on javascript which worked perfectly) and it won't work as it's parsed differently. I've identified the cause of the issue but don't have time to find another "solution" for you so you'll have to hope someone else comes to your aid. |
![]() |
|
| Kankuro | Feb 7 2015, 11:30 PM Post #14 |
|
かんくろ
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I've been talking to a very educated coder about this and it's a slow process but I've been relaying the information I receive to Cory. So hopefully he can sort it out. Thanks for trying though
Edited by Kankuro, Feb 7 2015, 11:30 PM.
|
![]() |
|
| RedBldSandman | Feb 8 2015, 04:24 PM Post #15 |
![]()
Asante sana Squash banana
![]() ![]() ![]() ![]() ![]() ![]()
|
I had a couple of minutes and came up with a more elegant solution which should work for all cases. Javascripts Below The Board
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Closed Requests · Next Topic » |
- Pages:
- 1
- 2
| Track Topic · E-mail Topic |
8:30 PM Jul 10
|


![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)





8:30 PM Jul 10