garysieling / jquery-highlighttextarea

http://garysieling.github.io/jquery-highlighttextarea/
156 stars 75 forks source link

Adding a class to <mark> tags to facilitate styling (only for ranges) #51

Closed olance closed 9 years ago

olance commented 9 years ago

This PR adds the possibility to set a class property in ranges objects, that will be set on the generated <mark> tags so that it is easier to style different marks.

olance commented 9 years ago

that was quick :)

mistic100 commented 9 years ago

could you do the same for words ?

olance commented 9 years ago

I've had a quick look but it's going to need a bit more work, as you only store words in an array in the end, if I am not mistaken, so it's not as easy as putting a new property in the "cleaned" words objects.

But I can try! ^^

mistic100 commented 9 years ago

In Utilities.cleanWords

Instead of

out = {
  'red': ['word1', 'word2']
};

it could be

out = [
  {
    color: 'red',
    words: ['word1', 'word2']
  }
];

it's more consistent with the cleaned ranges list

yes I admit it's a bit more refactoring


all the possible syntaxes are documented nowhere, that's really bad

olance commented 9 years ago

Okay that's a start, I'll have a look :) And I'll update the README maybe? ^^

mistic100 commented 9 years ago

not the readme, the gh-pages branch

olance commented 9 years ago

Okay