To quickly test the edited style files, simply use the language selection in MarkMyWords. To reload a style simply select a different language and then go back to the language whose styles have been edited. A restart of MarkMyWords is not necessary.
If the structure of the highlight style files is broken, they will not load, but MarkMyWords will continue to work.
In the case that MarkMyWords should stop working, just delete the edited style files and restart MarkMyWords. In this case, MarkMyWords will copy the original style files to the appropriate application support directory to restore the highlighting feature.
Simple String Styles Code
sample code
<dict>
<key> searchFor </key>
<string> +quote+ </string>
<key> foregroundColor </key>
<string> #FF0000 </string>
<key> backgroundColor </key>
<string> #FFFFFF </string>
<key> useBackgroundColor </key>
<false/>
<key> useBold </key>
<true/>
<key> useItalic </key>
<false/>
</dict>
The searchFor parameter must be HTML valid, meaning that special characters must be declared in their HTML entity.
Example: Search for: <thisItem>; must be declared as follows <thisItem>
Complex Regular Expressions Styles
Code Example
<dict>
<key> searchFor </key>
<string> \*{2,5}(.*?)\*{2,5} </string>
<key> foregroundColor </key>
<string> #FF0000 </string>
<key> backgroundColor </key>
<string> #FFFFFF </string>
<key> useBackgroundColor </key>
<false/>
<key> useBold </key>
<true/>
<key> useItalic </key>
<false/>
</dict>
The regular expression code used is virtually identical to that for the normal strings. The big difference is the value for the searchFor property, which is a regular expression. As you can see in the code example, special characters have to be provided with a single \ as expected.