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

Implement TextHighlighter #52

Closed
qiangxue opened this issue Mar 29, 2013 · 14 comments
Closed

Implement TextHighlighter #52

qiangxue opened this issue Mar 29, 2013 · 14 comments
Assignees

Comments

@qiangxue
Copy link
Member

Should we provide it in the core?

@resurtm
Copy link
Contributor

resurtm commented Mar 29, 2013

Geshi proposal: yiisoft/yii#1004

@resurtm
Copy link
Contributor

resurtm commented Mar 30, 2013

Don't know whether it makes sense, but IMHO it makes: how about implementing client side highlighter too? There is very impressive highlight.js (1, 2).

Just an abstract idea: we could create some kind of a universal highlighter with almost seamless switching between server (GeSHi) and client (highlight.js) side modes. I'm interested in your opinions about this idea.

(Will do investigations on the possibility of doing that.)

@cebe
Copy link
Member

cebe commented Mar 30, 2013

Why would someone want to highlight code on client side?
The only reason I can imagine is highlighting input of textarea when you enter code, but all display can be rendered by the server without taking browser performance...

@mdomba
Copy link
Member

mdomba commented Mar 31, 2013

on the other side, by using a client highlighter the content passed from server to the client is clear text i.e. smaller (faster)... and it saves server performance :D

@cebe
Copy link
Member

cebe commented Mar 31, 2013

Server is far more powerfull than client in most cases and when using a javascript there is always a lag seen by the user until loaded dom is manipulated by highlighter.
Can't find any pro arguments...

http://stackoverflow.com/questions/70169/how-to-highlight-source-code-in-html

Also some comments from: http://www.hanselman.com/blog/BestCodeSyntaxHighlighterForSnippetsInYourBlog.aspx

a) it supposes that you have JS on (not always the case, especially when using NoScript)
b) it doesn't work in Google Reader (and possible other feedreaders)

...

Don't you think it's a little lame to not show the syntax highlighting to feed readers? That seems like an
incomplete solution. I had no idea you were using any special syntax highlighting until I visited this post.

@klimov-paul
Copy link
Member

Client side hightlighting can be usefull while creating preview. It allows to see how the message will look like without triggering the server with Ajax.
Although client side highlighting has lot of problems. GitHub, for example, does not bother with it and simply uses Ajax.

@yiidevelop
Copy link
Contributor

I have used CTextHighlighter on yii 1.1 and it very good.
If @qiangxue dont implement TextHighlighter to yii2 then i must copy same widgets as CFilterWidget, COutputProcessor, CTextHighlighter to my app/extension and restyle with yii2.

I feel it is inconvenient because I'm not the author of those widgets and i need to use it on yii2

@qiangxue plz, review and implement those

Thanks

@samdark
Copy link
Member

samdark commented Jun 20, 2013

I've provided a list in #47 Will be great to get some opinions.

@yiidevelop
Copy link
Contributor

@samdark
yii\helpers\Markdown "Markdown provides an ability to transform markdown into HTML."
It have not yet support TextHighlighter

@ghost ghost assigned cebe Dec 17, 2013
@samdark samdark mentioned this issue Jan 6, 2014
6 tasks
@cebe cebe modified the milestones: 2.0 RC, 2.0 Beta Feb 26, 2014
@qiangxue qiangxue modified the milestones: 2.0 RC, 2.0 Beta Mar 10, 2014
@qiangxue qiangxue modified the milestones: 2.1, 2.0 RC, 2.0 GA Apr 16, 2014
@samdark
Copy link
Member

samdark commented Apr 10, 2015

https://github.com/scrivo/highlight.php is still a good solution for it.

@cebe
Copy link
Member

cebe commented Apr 11, 2015

not sure if we really need support for it in the core... maybe better create it as an official extension?
In general I think we have a bit too many things in the core which solve only very specific use cases.
Imo we should use 2.1 to clean up in this regard a little bit.

@samdark
Copy link
Member

samdark commented Apr 12, 2015

I was thinking about highlighting of error pages / debug and apidoc rendered pages. Not sure it can be done w/o requiring more code in the core.

@cebe
Copy link
Member

cebe commented Apr 12, 2015

okay, makes sense.

@dynasource
Copy link
Member

as can be concluded from this discussion, it can be a whole architecture on its own. Out of the cores scope.

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

8 participants