Skip to content

Commit

Permalink
Ignore repeated characters inside code
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Dec 4, 2023
1 parent 7ed00e2 commit 7b1be7a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public enum SemanticType {
TITLE("Title"),
BLOCK_QUOTE("BlockQuote"),
NOTE("Note"),
CODE("Code"),
PART("Part");

private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class SemanticTypeMapper {
map.put(SemanticType.TITLE.getValue(), SemanticType.TITLE);
map.put(SemanticType.NOTE.getValue(), SemanticType.NOTE);
map.put(SemanticType.BLOCK_QUOTE.getValue(), SemanticType.BLOCK_QUOTE);
map.put(SemanticType.CODE.getValue(), SemanticType.CODE);
map.put(SemanticType.PART.getValue(), SemanticType.PART);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void checkForRepeatedCharacters(ITree tree) {

public void checkForRepeatedCharacters(INode node, List<TextChunk> chunks) {
for (INode child : node.getChildren()) {
if (child.getInitialSemanticType() != SemanticType.FIGURE) {
if (child.getInitialSemanticType() != SemanticType.FIGURE && child.getInitialSemanticType() != SemanticType.CODE) {
checkForRepeatedCharacters(child, chunks);
}
if (child instanceof SemanticSpan) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public static void updateContainers(IDocument document) {
StaticContainers.groupCounter.set(0L);
StaticContainers.structElementsNumber.set(0L);
StaticContainers.textChunksNumber.set(0L);
if (StaticContainers.getWCAGValidationInfo() == null) {
StaticContainers.setWCAGValidationInfo(new WCAGValidationInfo());
}
}

public static IDocument getDocument() {
Expand Down

0 comments on commit 7b1be7a

Please sign in to comment.