MySQL highlighter
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Jcart wrote:You thought rightCode: Select all
SELECT `answer` FROM `jcart` LIMIT 1
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
nevermind, i was reading pattern syntax and i got it 
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
this was my original output
so now it looks like
i was trying to highlight FROM and DESC, but when i had ^ in my pattern, it only highlighted the first word. i wanted it to highlight FROM and DESCSELECT
`hj`
FROM
hi DESC
so now it looks like
Code: Select all
SELECT
`hj`
FROM
hi DESC
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You don't have to edit more than one file to get GeSHi to highlight differently. The syntax configuration is stored in one file for each language. Just edit the geshi/sql.php file. It's a big array with all the definitions and colors in it. You can change it to whatever you need. Considering GeSHi highlights declarative languages like HTML and YAML just as well as it highlights things like C, PHP and Java I would think you'll have better success with it. All you have to do is change the definitions.ziggy3000 wrote:what should my pattern be if i want to highlight = to green?
this is what i am putting as my pattern, replacement, and my output
Pattern : "/=/"
replacement: "<div style='color:green'> \\1 </div>"
output:'color:green'>
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
There's no \\1 in your pattern because there's no parentheses in it. Put ( and ) around the bit you want to access as \\1.ziggy3000 wrote:yes i know, i already tried that. can you guys just help me with what i need, and not talk about geshi
the geshi only has arrays, not the code they used to highlight the arrays.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: