rubychan / coderay

Fast and easy syntax highlighting for selected languages, written in Ruby.
http://coderay.rubychan.de/
Other
846 stars 115 forks source link

Improved Web Adaptiveness of tables with line numbers #181

Open focorunner opened 9 years ago

focorunner commented 9 years ago

Currently, all line numbers are in one td element, and all code is in a second td element within a single row, when :table output is desired. This is find for fixed-width layouts, but no so good for adaptiveness, because as width decreases, even if you use styled to break lines in the code, you have no way of keeping line numbers in place relative to their corresponding lines of code. Each line number and line of code should be in a separate table row... This would also preserve the handle cut-paste code (without line numbers) capability for those viewing the code in apps.

korny commented 9 years ago

You're right that the current table style doesn't work when breaking lines. The :list style is better for this situation.

However, in my tests, it breaks copy/paste. At least it did when I was developing this years ago. Mobile wasn't important, and browsers were stupid. Maybe we should tweak this.

Did you actually try to make a patch for this? Which browsers did you test?