Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing invisible characters #4

Closed
kizu opened this issue Jul 11, 2012 · 6 comments
Closed

Showing invisible characters #4

kizu opened this issue Jul 11, 2012 · 6 comments

Comments

@kizu
Copy link
Contributor

kizu commented Jul 11, 2012

While this can be easy, but there are few issues to thought on:

  • Do we need to highlight all the special characters like tab symbol? While highlighting the non-breakable spaces would be always good, highlighting the tabs would be trashy for indentations that use them.
  • Do we need to highlight line breaks or any other special white-space symbols?
  • Can we do the highlighting of such symbols only on the text selection like it can be done in the Sublime Text?
@LeaVerou
Copy link
Member

The problem with this is that it breaks copying the code. I really don’t want to have to add a separate view mode for copying code, like some other highlighters. :(

@kizu
Copy link
Contributor Author

kizu commented Jul 11, 2012

What exactly would break copying? There would be only some CSS styles like backgrounds (like small light gray circle for nbsp), I don't think those would break anything.

@LeaVerou
Copy link
Member

Oh, that’s what you were thinking. I was thinking of using unicode characters to show it.
Using images would mean I’d have to distribute images together with Prism, which makes it harder to use it and increases the size of the file.
Perhaps a solution would be to use pseudoelements somehow, since they're not selectable.

@kizu
Copy link
Contributor Author

kizu commented Jul 11, 2012

But we can use gradients! Like this — http://dabblet.com/gist/3092469 — it's very quick rough example, but you can get the idea.

@LeaVerou
Copy link
Member

The problem with gradients is that they don't inherit the text-shadow and they look aliased.

@LeaVerou
Copy link
Member

Btw, not sure if you noticed (or if I wrote it elsewhere), but I've coded a first version of this plugin: http://leaverou.github.com/prism/plugins/show-invisibles/

@LeaVerou LeaVerou closed this as completed Nov 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants