diff options
| author | krasimir <krasimir@chalmers.se> | 2010-07-31 16:04:15 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-07-31 16:04:15 +0000 |
| commit | 98c22ef92b14491fd36dc3545f07ab62f92f6e02 (patch) | |
| tree | 2e1d9e6ca3d0ec6c97ca55d8705066752f1e32d4 /src | |
| parent | 6a1dbd0a53a0201d1d964ac15d2c732f4005c23f (diff) | |
bugfix in the PGF browser
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/PGFService.hs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs index 75670adbf..d79cf644b 100644 --- a/src/server/PGFService.hs +++ b/src/server/PGFService.hs @@ -327,17 +327,21 @@ doBrowse pgf id cssClass href = identifiers = PGF.functions pgf ++ PGF.categories pgf - annotate [] = [] + annotate [] = [] annotate (c:cs) - | isSpace c = c : annotate cs - | otherwise = let (id,cs') = break isSpace (c:cs) - in (if PGF.mkCId id `elem` identifiers - then mkLink id - else if id == "fun" || id == "data" || id == "cat" || id == "def" - then "<B>"++id++"</B>" - else id) ++ - annotate cs' + | isIdentInitial c = let (id,cs') = break (not . isIdentChar) (c:cs) + in (if PGF.mkCId id `elem` identifiers + then mkLink id + else if id == "fun" || id == "data" || id == "cat" || id == "def" + then "<B>"++id++"</B>" + else id) ++ + annotate cs' + | otherwise = c : annotate cs + annotateCIds ids = unwords (map (mkLink . PGF.showCId) ids) + + isIdentInitial c = isAlpha c || c == '_' + isIdentChar c = isAlphaNum c || c == '_' || c == '\'' hrefAttr id = case href of |
