mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
One more isalpha issue. Original routine also removed too much, I think.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36352 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4bf281106b
commit
01ec30ca86
@ -996,14 +996,20 @@ string Layout::defaultCSSClass() const
|
||||
docstring::const_iterator it = name().begin();
|
||||
docstring::const_iterator en = name().end();
|
||||
for (; it != en; ++it) {
|
||||
if (!isalpha(*it))
|
||||
continue;
|
||||
if (islower(*it))
|
||||
d += *it;
|
||||
else
|
||||
d += lowercase(*it);
|
||||
char_type const c = *it;
|
||||
if (c >= 0x80 || !isalnum(c)) {
|
||||
if (d.empty())
|
||||
// make sure we don't start with an underscore,
|
||||
// as that sometimes causes problems.
|
||||
d = from_ascii("lyx_");
|
||||
else
|
||||
d += '_';
|
||||
} else if (islower(c))
|
||||
d += c;
|
||||
else
|
||||
// this is slow, so do it only if necessary
|
||||
d += lowercase(c);
|
||||
}
|
||||
// are there other characters we need to remove?
|
||||
defaultcssclass_ = to_utf8(d);
|
||||
return defaultcssclass_;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user