diff options
| author | hallgren <hallgren@chalmers.se> | 2011-10-03 12:28:49 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2011-10-03 12:28:49 +0000 |
| commit | 7402ff24293c7bd1bcdabdef8681333081eeb3c2 (patch) | |
| tree | f4b8618338483680a72fffaf794084bd11dfb5dc /src/example-based | |
| parent | dfbf4f9e145a482aa85d42e7373422fd57d619b3 (diff) | |
gfse: browser compatibility fixes
Diffstat (limited to 'src/example-based')
| -rw-r--r-- | src/example-based/ExampleDemo.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/example-based/ExampleDemo.hs b/src/example-based/ExampleDemo.hs index b64d1d7a2..49aa6d218 100644 --- a/src/example-based/ExampleDemo.hs +++ b/src/example-based/ExampleDemo.hs @@ -67,9 +67,11 @@ provideExample env myfunc parsePGF pgfFile lang = giveExample e_ = let newexpr = head $ generateFromDepth pgfFile e_ (Just 5) -- change here with the new random generator ty = getType $ head $ filter (\x -> getName x == myfunc) $ getAll env - embeddedExpr = maybe "" (\x -> "\nas in :" ++ linearize pgfFile lang x) (embedInStart (getAll env) (Map.fromList [(ty,e_)])) + embeddedExpr = maybe "" (\x -> ", as in: " ++ q (linearize pgfFile lang x)) (embedInStart (getAll env) (Map.fromList [(ty,e_)])) lexpr = linearize pgfFile lang newexpr - in (newexpr,"\n" ++ lexpr ++ embeddedExpr) + q s = sq++s++sq + sq = "\"" + in (newexpr,q lexpr ++ embeddedExpr) -- question, you need the IO monad for the random generator, how to do otherwise ?? -- question can you make the expression bold/italic - somehow distinguishable from the rest ? |
