Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
6db7d12b
Commit
6db7d12b
authored
Apr 06, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[searchfield] term escape double quotes
parent
8627e463
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+5
-4
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
6db7d12b
...
...
@@ -7,7 +7,8 @@ import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Newtype (over)
import Data.Nullable (null)
import Data.Set as Set
import Data.String.Common (joinWith)
import Data.String.Common (joinWith, replaceAll)
import Data.String.Pattern (Pattern(..), Replacement(..))
import Data.Tuple (Tuple(..))
import DOM.Simple.Console (log, log2)
import Effect (Effect)
...
...
@@ -613,15 +614,15 @@ searchQuery selection { databases, datafield, lang, term, node_id } =
queryHAL :: String -> Maybe (Set.Set IMT_org) -> Maybe Lang -> Array String -> String
queryHAL term mIMTOrgs lang years =
"(" <> langPrefix <> "_title_t:
\"
" <> termEscaped <>
"
\"
OR " <> langPrefix <> "_abstract_t:\"" <> termEscaped <> "\")" <>
"(" <> langPrefix <> "_title_t:" <> termEscaped <>
" OR " <> langPrefix <> "_abstract_t:\"" <> termEscaped <> "\")" <>
structQuery <> yearQuery
where
langPrefix = case lang of
Just FR -> "fr"
_ -> "en"
-- TODO: Escape double quotes
termEscaped =
term
termEscaped =
"\"" <> (replaceAll (Pattern "\"") (Replacement "\\\"") term) <> "\""
structQuery = case mIMTOrgs of
Nothing -> ""
Just imtOrgs -> if Set.isEmpty imtOrgs then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment