use of org.commonmark.node.Node in project hippo by NHS-digital-website.
the class TableBlockNodeRenderer method renderChildren.
private void renderChildren(Node parent) {
Node node = parent.getFirstChild();
while (node != null) {
Node next = node.getNext();
context.render(node);
node = next;
}
}
use of org.commonmark.node.Node in project hippo by NHS-digital-website.
the class CodeAttributeProviderTest method ignoresElementOtherThanCode.
@Test
public void ignoresElementOtherThanCode() {
// given
final Node nodeOtherThanCode = new TableBlock();
// when
codeAttributeProvider.setAttributes(nodeOtherThanCode, "tagName is ignored", attributes);
// then
then(attributes).shouldHaveZeroInteractions();
}
use of org.commonmark.node.Node in project hippo by NHS-digital-website.
the class ListAttributeProviderTest method setsCssClassOnBulletListElement.
@Test
public void setsCssClassOnBulletListElement() {
// given
final Node nodeBulletList = new BulletList();
// when
listAttributeProvider.setAttributes(nodeBulletList, "tagName is ignored", attributes);
// then
then(attributes).should().put("class", "nhsd-t-list nhsd-t-list--bullet");
then(attributes).shouldHaveNoMoreInteractions();
}
use of org.commonmark.node.Node in project hippo by NHS-digital-website.
the class HyperlinkAttributeProviderTest method ignoresElementOtherThanLink.
@Test
public void ignoresElementOtherThanLink() {
// given
final Node nodeOtherThanLink = new TableBlock();
// when
hyperlinkAttributeProvider.setAttributes(nodeOtherThanLink, "tagName is ignored", attributes);
// then
then(attributes).shouldHaveZeroInteractions();
}
use of org.commonmark.node.Node in project hippo by NHS-digital-website.
the class HyperlinkAttributeProviderTest method setsHyperlinkCssClassOnLinkElement.
@Test
public void setsHyperlinkCssClassOnLinkElement() {
// given
final Node nodeLink = new Link();
// when
hyperlinkAttributeProvider.setAttributes(nodeLink, "tagName is ignored", attributes);
// then
then(attributes).should().put("class", "nhsd-a-link");
then(attributes).shouldHaveNoMoreInteractions();
}
Aggregations