forked from GitHub/gf-core
bugfix in the PGF browser
This commit is contained in:
@@ -327,17 +327,21 @@ doBrowse pgf id cssClass href =
|
|||||||
|
|
||||||
identifiers = PGF.functions pgf ++ PGF.categories pgf
|
identifiers = PGF.functions pgf ++ PGF.categories pgf
|
||||||
|
|
||||||
annotate [] = []
|
annotate [] = []
|
||||||
annotate (c:cs)
|
annotate (c:cs)
|
||||||
| isSpace c = c : annotate cs
|
| isIdentInitial c = let (id,cs') = break (not . isIdentChar) (c:cs)
|
||||||
| otherwise = let (id,cs') = break isSpace (c:cs)
|
in (if PGF.mkCId id `elem` identifiers
|
||||||
in (if PGF.mkCId id `elem` identifiers
|
then mkLink id
|
||||||
then mkLink id
|
else if id == "fun" || id == "data" || id == "cat" || id == "def"
|
||||||
else if id == "fun" || id == "data" || id == "cat" || id == "def"
|
then "<B>"++id++"</B>"
|
||||||
then "<B>"++id++"</B>"
|
else id) ++
|
||||||
else id) ++
|
annotate cs'
|
||||||
annotate cs'
|
| otherwise = c : annotate cs
|
||||||
|
|
||||||
annotateCIds ids = unwords (map (mkLink . PGF.showCId) ids)
|
annotateCIds ids = unwords (map (mkLink . PGF.showCId) ids)
|
||||||
|
|
||||||
|
isIdentInitial c = isAlpha c || c == '_'
|
||||||
|
isIdentChar c = isAlphaNum c || c == '_' || c == '\''
|
||||||
|
|
||||||
hrefAttr id =
|
hrefAttr id =
|
||||||
case href of
|
case href of
|
||||||
|
|||||||
Reference in New Issue
Block a user