Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
f4b1953f
Commit
f4b1953f
authored
Oct 28, 2019
by
Piotr Gawron
Browse files
allow empty notes node
parent
6ce765c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java
View file @
f4b1953f
...
...
@@ -337,7 +337,9 @@ public class RestAnnotationParser {
notes
=
XmlParser
.
nodeToString
(
node
).
trim
();
}
else
{
Node
bodyNode
=
XmlParser
.
getNode
(
"body"
,
htmlNode
.
getChildNodes
());
notes
=
XmlParser
.
nodeToString
(
bodyNode
).
trim
();
if
(
bodyNode
!=
null
)
{
notes
=
XmlParser
.
nodeToString
(
bodyNode
).
trim
();
}
}
if
(
notes
.
indexOf
(
"</head>"
)
>=
0
)
{
...
...
converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParserTest.java
View file @
f4b1953f
...
...
@@ -274,6 +274,21 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
rap
.
getNotes
(
node
);
}
@Test
public
void
testGetNotesWithMissingBody
()
throws
Exception
{
RestAnnotationParser
rap
=
new
RestAnnotationParser
();
Node
node
=
super
.
getNodeFromXmlString
(
"<celldesigner:notes>\n"
+
" <html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
+
" <head>\n"
+
" <title/>\n"
+
" </head>\n"
+
" </html>\n"
+
" </celldesigner:notes>"
);
String
notes
=
rap
.
getNotes
(
node
);
assertNotNull
(
notes
);
}
@Test
public
void
testGetNotesWithLinkInside
()
throws
Exception
{
RestAnnotationParser
rap
=
new
RestAnnotationParser
();
...
...
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