russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.42k stars 598 forks source link

Support for farsi and arabic numerals for footnotes #542

Open hirmanpour opened 5 years ago

hirmanpour commented 5 years ago

Hi,

I use Hugo to generate a website with farsi (iranian) content. At the moment, a footnote with farsi numerals, for example [^۱۲] does not work, so I have to write that footnote [^12] and handle substitution of numerals with javascript, which is taxing on the client side for long texts.

It would be great if blackfriday could support farsi and arabic numerals in footnotes.

For the record, farsi and arabic digits encoding in unicode are as follows:

Name Persian Unicode Arabic Unicode
0 ۰ U+06F0 ٠ U+0660
1 ۱ U+06F1 ١ U+0661
2 ۲ U+06F2 ٢ U+0662
3 ۳ U+06F3 ٣ U+0663
4 ۴ U+06F4 ٤ U+0664
5 ۵ U+06F5 ٥ U+0665
6 ۶ U+06F6 ٦ U+0666
7 ۷ U+06F7 ٧ U+0667
8 ۸ U+06F8 ٨ U+0668
9 ۹ U+06F9 ٩ U+0669

Would it be difficult to add such a support ?

Many thanks for your work !

Arach