File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ targetResultDisplay link color qs Target{..} = unHTML $ unwords $
8181 [" -- " ++ targetURL | link]
8282
8383ansiHighlight :: [Query ] -> String -> String
84- ansiHighlight = highlightItem id ((dull ++ ) . (++ rst)) ((bold ++ ) . (++ rst))
84+ ansiHighlight = highlightItem id id ((dull ++ ) . (++ rst)) ((bold ++ ) . (++ rst))
8585 where
8686 dull = setSGRCode [SetColor Foreground Dull Yellow ]
8787 bold = setSGRCode [SetColor Foreground Vivid Yellow ]
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ showURL _ _ x = x
256256
257257
258258displayItem :: [Query ] -> String -> Markup
259- displayItem = highlightItem H. preEscapedString H. string (H. b . H. string)
259+ displayItem = highlightItem H. string H. preEscapedString H. string (H. b . H. string)
260260
261261action_server_test_ :: IO ()
262262action_server_test_ = do
Original file line number Diff line number Diff line change @@ -190,20 +190,20 @@ item_test = testing "Input.Item.Target JSON (encode . decode = id) " $ do
190190 (Left e ) -> False
191191 (Right t') -> t == t'
192192
193- highlightItem :: Monoid m => (String -> m ) -> (String -> m ) -> (String -> m ) -> [Query ] -> String -> m
194- highlightItem plain dull bold qs x
193+ highlightItem :: Monoid m => (String -> m ) -> (String -> m ) -> (String -> m ) -> ( String -> m ) -> [Query ] -> String -> m
194+ highlightItem plain safe dull bold qs x
195195 | Just (pre,x) <- stripInfix " <s0>" x, Just (name,post) <- stripInfix " </s0>" x
196- = plain pre <> highlight (unescapeHTML name) <> plain post
196+ = safe pre <> highlight (unescapeHTML name) <> safe post
197197 | otherwise = plain x
198198 where
199199 highlight = mconcatMap (\ xs@ ((b,_): _) -> let s = map snd xs in if b then bold s else dull s) .
200- groupOn fst . (\ x -> zip (mapIsInQueries x) x)
200+ groupOn fst . (\ x -> zip (findQueries x) x)
201201 where
202- mapIsInQueries :: String -> [Bool ]
203- mapIsInQueries (x: xs) | m > 0 = replicate m True ++ (mapIsInQueries $ drop (m - 1 ) xs)
202+ findQueries :: String -> [Bool ]
203+ findQueries (x: xs) | m > 0 = replicate m True ++ drop (m - 1 ) (findQueries xs)
204204 where m = maximum $ 0 : [length y | QueryName y <- qs, lower y `isPrefixOf` lower (x: xs)]
205- mapIsInQueries (x: xs) = False : mapIsInQueries xs
206- mapIsInQueries [] = []
205+ findQueries (x: xs) = False : findQueries xs
206+ findQueries [] = []
207207
208208---------------------------------------------------------------------
209209-- HSE CONVERSION
You can’t perform that action at this time.
0 commit comments