Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 360
- Log:
Don't munge WikiWord titles since we don't allow WikiWord links in our data.
- Author:
- rool
- Date:
- Sat Mar 19 22:00:45 +0000 2011
- Size:
- 2568 Bytes
1 | #coding: utf-8 |
2 | # Contains all the methods for finding and replacing wiki words |
3 | |
4 | require 'instiki_stringsupport' |
5 | |
6 | module WikiWords |
7 | # In order of appearance: Latin, greek, cyrillic, armenian |
8 | I18N_HIGHER_CASE_LETTERS = |
9 | "ÀÁÂÃÄÅĀĄĂÆÇĆČĈĊĎĐÈÉÊËĒĘĚĔĖĜĞĠĢĤĦÌÍÎÏĪĨĬĮİIJĴĶŁĽĹĻĿÑŃŇŅŊÒÓÔÕÖØŌŐŎŒŔŘŖŚŠŞŜȘŤŢŦȚÙÚÛÜŪŮŰŬŨŲŴŶŸȲÝŹŽŻ" + |
10 | "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" + |
11 | "ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢ" + |
12 | "ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖ" |
13 | |
14 | I18N_LOWER_CASE_LETTERS = |
15 | "àáâãäåāąăæçćĉċčďđèéêëēęěĕėƒĝğġģĥħìíîïīĩĭįıijĵķĸłľĺļŀñńňņʼnŋòóôõöøōŏőœŕřŗśŝšşșťţŧțùúûüūůűŭũųŵýÿŷžżźÞþßſð" + |
16 | "άέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώΐ" + |
17 | "абвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣ" + |
18 | "աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆև" |
19 | |
20 | WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + ']+[A-Z' + I18N_HIGHER_CASE_LETTERS + |
21 | '][A-Za-z0-9_' + I18N_HIGHER_CASE_LETTERS + I18N_LOWER_CASE_LETTERS + ']+' |
22 | CAMEL_CASED_WORD_BORDER = /([a-z#{I18N_LOWER_CASE_LETTERS}])([A-Z#{I18N_HIGHER_CASE_LETTERS}])/u |
23 | |
24 | def self.separate(wiki_word) |
25 | |
26 | # 2011-03-13 (ADH): The ROOL Wiki only supports [[these]] links as allowing |
27 | # CamelCase would fall foul of numerous non-link cases in |
28 | # its technical content. Accordingly, when the Wiki shows |
29 | # titles for missing pages and so forth, we *don't* want |
30 | # it to mungle the title. Really, Instiki probably ought |
31 | # to disable this according to the relevant Web setting |
32 | # but it doesn't pass that information down to here. |
33 | # |
34 | # wiki_word.dup.as_utf8.gsub(CAMEL_CASED_WORD_BORDER, '\1 \2') |
35 | |
36 | return wiki_word.dup.as_utf8 |
37 | end |
38 | |
39 | end |