Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gy4443
chemotion_eln_server
Commits
9fc5653a
Commit
9fc5653a
authored
Sep 29, 2017
by
An Nguyen
Browse files
Add new format for ",3 H" -> ", 3H"
parent
c31ead60
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/components/utils/ElementUtils.js
View file @
9fc5653a
...
...
@@ -47,6 +47,22 @@ const formatChemicalFormular = (formular) => {
const
sampleAnalysesFormatPattern
=
{
_13cnmr
:
[
{
pattern
:
'
(,{0,1}) (
\\
d+
\\
.){0,1}(
\\
d*) {0,1}H(,|
\\
))
'
,
replace
:
{
ops
:
[
{
insert
:
'
#{1}#{2}#{3}H#{4}
'
},
],
},
},
{
pattern
:
'
(,{0,1})(
\\
d+
\\
.){0,1}(
\\
d*) {0,1}H(,|
\\
))
'
,
replace
:
{
ops
:
[
{
insert
:
'
#{1} #{2}#{3}H#{4}
'
},
],
},
},
{
pattern
:
'
13C NMR
'
,
replace
:
{
...
...
@@ -143,6 +159,22 @@ const sampleAnalysesFormatPattern = {
},
],
_1hnmr
:
[
{
pattern
:
'
(,{0,1}) (
\\
d+
\\
.){0,1}(
\\
d*) {0,1}H(,|
\\
))
'
,
replace
:
{
ops
:
[
{
insert
:
'
#{1}#{2}#{3}H#{4}
'
},
],
},
},
{
pattern
:
'
(,{0,1})(
\\
d+
\\
.){0,1}(
\\
d*) {0,1}H(,|
\\
))
'
,
replace
:
{
ops
:
[
{
insert
:
'
#{1} #{2}#{3}H#{4}
'
},
],
},
},
{
pattern
:
'
1H NMR
'
,
replace
:
{
...
...
app/assets/javascripts/components/utils/quillFormat.js
View file @
9fc5653a
...
...
@@ -30,7 +30,7 @@ const mapValueToGroupRegex = (content, matchedGroup) => {
const
patt
=
`#{
${
idx
+
1
}
}`
;
const
insertString
=
d
.
insert
;
const
dd
=
{
...
d
};
dd
.
insert
=
insertString
.
replace
(
patt
,
m
);
dd
.
insert
=
insertString
.
replace
(
patt
,
m
||
''
);
return
dd
;
});
});
...
...
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