[ / / / / / / / / / ] [ dir / 55tg / asmr / brit / imouto / nofap / polfaq / rwby / u ]

/8code/ - Infinite Code

Discussion about 8chan's codebase.

Catalog

Banned? Try something /new/
Email
Subject
Comment *
File *
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 12 MB.
Max image dimensions are 10000 x 10000.
You may upload 4 per post.


Rules and Info: https://8chan.co/8code/rules.html | Main Repository: https://github.com/ctrlcctrlv/8chan/ | Archive: http://8archive.moe/8code/

File: 1418553276656.png (377.75 KB, 454x603, 454:603, AnsiC_StopTreatingThemLike….png)

155a4b No.2[Reply]

Something I dislike about code tags both on Halfchan and Fullchan is their lack of flexibility. Fullchan's code tags eat tabs (whereas Halfchan's converts them to four spaces), and neither of them is syntax aware. Both of them will highlight keywords arbitrarily as long as they're used in some sort of programming language, and will treat certain symbols as comments or quotes regardless of what language they're in. This makes them very bad for Lisp based languages, which often use single quotes and # characters to represent symbols and characters. I think we can do better than that.

Rather than our current approach to code tags, perhaps we could do something like <code lang="C"></code> (but as BBcode obviously), and have it perform syntax highlighting based on that language. If no language is provided, it would do the default action it currently uses (except maybe not eating tab characters and looking like total shit on mobile).

What would it take to get something like this implemented?

fcd228 No.3

>>2
I think it could be possible by making use of the ACE editor highlighting syntax.
https://github.com/ajaxorg/ace-builds/blob/master/src-noconflict/
8chan currently uses prettify.css for highlighting the DOM, but I'm not sure what is used to filter the BBCode into markup content yet.
It's probably more involved than any of the contributors/devs want to deal with atm though, so it might be a while before it gets tackled.



Delete Post [ ]
[]
[1] [2] Next | Catalog
[ / / / / / / / / / ] [ dir / 55tg / asmr / brit / imouto / nofap / polfaq / rwby / u ]