-
Notifications
You must be signed in to change notification settings - Fork 267
/
HtmlIdGenerator.java
42 lines (32 loc) · 1.14 KB
/
HtmlIdGenerator.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.vladsch.flexmark.html.renderer;
import com.vladsch.flexmark.ast.util.AnchorRefTargetBlockPreVisitor;
import com.vladsch.flexmark.util.ast.Document;
import com.vladsch.flexmark.util.ast.Node;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface HtmlIdGenerator {
HtmlIdGenerator NULL = new HtmlIdGenerator() {
@Override
public void generateIds(Document document) {
}
@Override
public void generateIds(Document document, @Nullable AnchorRefTargetBlockPreVisitor preVisitor) {
}
@Nullable
@Override
public String getId(@NotNull Node node) {
return null;
}
@Nullable
@Override
public String getId(@NotNull CharSequence text) {
return null;
}
};
void generateIds(Document document);
default void generateIds(Document document, @Nullable AnchorRefTargetBlockPreVisitor preVisitor) {
generateIds(document);
}
@Nullable String getId(@NotNull Node node);
@Nullable String getId(@NotNull CharSequence text);
}