|

Added Sandhi Page

In an effort to make this site more complete so that I could use it for my own studies instead of referring to my local Open Office docs, I decided it would be most useful to add the Sandhi charts next. This proved more difficult than I first expected. I thought I might just be able to cut and paste the document into a page, but the sandhi page is full of Sanskrit characters interspersed with English, and the cut-and-paste function in the WYSIWYG editor somehow sets the Sanskrit font (which in the document is Arial Unicode MS) to Tahoma! Or was it Times New Roman? At any rate, I began to go through the document and replace all the <span> tags that had style attributes designating the font family with <span class=”san”> tags. The class I have defined in custom CSS that I add to each page through a plugin so that it sets the font to Arial Unicode MS at a readable size. But not ever occurrence of that <span> tag needed to be replaced. It was also used around some of the English and symbols like the dash, etc. So, I was going through and finding the next occurrence and deciding whether I needed to replace it or not. Then, I figured out a regular expression search to just find the tag when it preceded a Sanskrit character. And then, once I tested it, it was a one click change. So that was handy.

For those interested, the regular expression I used was to search on:

<span style="font-family: 'Times New Roman', serif;">([ऀ-ॿ])

And to replace that with:

<span class="san">\1

Simple enough as regular expressions go. It just searches on the range of Unicode Devanāgarī characters (0900-097F): ([ऀ-ॿ]) Too bad I wasted 20 minutes doing the hunt-and-peck approach!

 

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *