Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
IEQEFCR
halo
提交
e879a0ac
H
halo
项目概览
IEQEFCR
/
halo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
halo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e879a0ac
编写于
9月 16, 2021
作者:
J
johnniang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix build error complained by newest IDEA
上级
092241cc
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
49 addition
and
50 deletion
+49
-50
src/main/java/run/halo/app/core/CommonResultControllerAdvice.java
.../java/run/halo/app/core/CommonResultControllerAdvice.java
+6
-7
src/main/java/run/halo/app/utils/footnotes/Footnote.java
src/main/java/run/halo/app/utils/footnotes/Footnote.java
+4
-4
src/main/java/run/halo/app/utils/footnotes/FootnoteBlock.java
...main/java/run/halo/app/utils/footnotes/FootnoteBlock.java
+5
-5
src/main/java/run/halo/app/utils/footnotes/FootnoteExtension.java
.../java/run/halo/app/utils/footnotes/FootnoteExtension.java
+4
-4
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteBlockParser.java
...alo/app/utils/footnotes/internal/FootnoteBlockParser.java
+4
-4
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteLinkRefProcessor.java
...pp/utils/footnotes/internal/FootnoteLinkRefProcessor.java
+13
-13
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteNodeFormatter.java
...o/app/utils/footnotes/internal/FootnoteNodeFormatter.java
+4
-4
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteNodeRenderer.java
...lo/app/utils/footnotes/internal/FootnoteNodeRenderer.java
+5
-5
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteRepository.java
...halo/app/utils/footnotes/internal/FootnoteRepository.java
+4
-4
未找到文件。
src/main/java/run/halo/app/core/CommonResultControllerAdvice.java
浏览文件 @
e879a0ac
package
run.halo.app.core
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
...
...
@@ -26,18 +25,18 @@ public class CommonResultControllerAdvice implements ResponseBodyAdvice<Object>
@Override
public
boolean
supports
(
MethodParameter
returnType
,
@No
t
Null
Class
<?
extends
HttpMessageConverter
<?>>
converterType
)
{
@No
n
Null
Class
<?
extends
HttpMessageConverter
<?>>
converterType
)
{
return
AbstractJackson2HttpMessageConverter
.
class
.
isAssignableFrom
(
converterType
);
}
@Override
@NonNull
public
final
Object
beforeBodyWrite
(
@Nullable
Object
body
,
@No
t
Null
MethodParameter
returnType
,
@No
t
Null
MediaType
contentType
,
@No
t
Null
Class
<?
extends
HttpMessageConverter
<?>>
converterType
,
@No
t
Null
ServerHttpRequest
request
,
@No
t
Null
ServerHttpResponse
response
)
{
@No
n
Null
MethodParameter
returnType
,
@No
n
Null
MediaType
contentType
,
@No
n
Null
Class
<?
extends
HttpMessageConverter
<?>>
converterType
,
@No
n
Null
ServerHttpRequest
request
,
@No
n
Null
ServerHttpResponse
response
)
{
MappingJacksonValue
container
=
getOrCreateContainer
(
body
);
// The contain body will never be null
beforeBodyWriteInternal
(
container
,
contentType
,
returnType
,
request
,
response
);
...
...
src/main/java/run/halo/app/utils/footnotes/Footnote.java
浏览文件 @
e879a0ac
...
...
@@ -7,7 +7,7 @@ import com.vladsch.flexmark.util.ast.Document;
import
com.vladsch.flexmark.util.ast.Node
;
import
com.vladsch.flexmark.util.ast.ReferencingNode
;
import
com.vladsch.flexmark.util.sequence.BasedSequence
;
import
org.
jetbrains.annotations.Not
Null
;
import
org.
springframework.lang.Non
Null
;
import
run.halo.app.utils.footnotes.internal.FootnoteRepository
;
/**
...
...
@@ -30,7 +30,7 @@ public class Footnote extends Node implements DelimitedNode, DoNotDecorate, Link
protected
int
referenceOrdinal
;
@No
t
Null
@No
n
Null
@Override
public
BasedSequence
getReference
()
{
return
text
;
...
...
@@ -80,14 +80,14 @@ public class Footnote extends Node implements DelimitedNode, DoNotDecorate, Link
this
.
footnoteBlock
=
footnoteBlock
;
}
@No
t
Null
@No
n
Null
@Override
public
BasedSequence
[]
getSegments
()
{
return
new
BasedSequence
[]
{
openingMarker
,
text
,
closingMarker
};
}
@Override
public
void
getAstExtra
(
@No
t
Null
StringBuilder
out
)
{
public
void
getAstExtra
(
@No
n
Null
StringBuilder
out
)
{
out
.
append
(
" ordinal: "
)
.
append
(
footnoteBlock
!=
null
?
footnoteBlock
.
getFootnoteOrdinal
()
:
0
).
append
(
" "
);
delimitedSegmentSpanChars
(
out
,
openingMarker
,
text
,
closingMarker
,
"text"
);
...
...
src/main/java/run/halo/app/utils/footnotes/FootnoteBlock.java
浏览文件 @
e879a0ac
...
...
@@ -10,8 +10,8 @@ import com.vladsch.flexmark.util.data.DataHolder;
import
com.vladsch.flexmark.util.sequence.BasedSequence
;
import
com.vladsch.flexmark.util.sequence.SequenceUtils
;
import
java.util.Objects
;
import
org.
jetbrains.annotations.Not
Null
;
import
org.
jetbrains.annotations
.Nullable
;
import
org.
springframework.lang.Non
Null
;
import
org.
springframework.lang
.Nullable
;
import
run.halo.app.utils.footnotes.internal.FootnoteRepository
;
/**
...
...
@@ -43,7 +43,7 @@ public class FootnoteBlock extends Block
@Nullable
@Override
public
Footnote
getReferencingNode
(
@No
t
Null
Node
node
)
{
public
Footnote
getReferencingNode
(
@No
n
Null
Node
node
)
{
return
node
instanceof
Footnote
?
(
Footnote
)
node
:
null
;
}
...
...
@@ -74,7 +74,7 @@ public class FootnoteBlock extends Block
}
@Override
public
void
getAstExtra
(
@No
t
Null
StringBuilder
out
)
{
public
void
getAstExtra
(
@No
n
Null
StringBuilder
out
)
{
out
.
append
(
" ordinal: "
).
append
(
footnoteOrdinal
).
append
(
" "
);
segmentSpan
(
out
,
openingMarker
,
"open"
);
segmentSpan
(
out
,
text
,
"text"
);
...
...
@@ -82,7 +82,7 @@ public class FootnoteBlock extends Block
segmentSpan
(
out
,
footnote
,
"footnote"
);
}
@No
t
Null
@No
n
Null
@Override
public
BasedSequence
[]
getSegments
()
{
return
new
BasedSequence
[]
{
openingMarker
,
text
,
closingMarker
,
footnote
};
...
...
src/main/java/run/halo/app/utils/footnotes/FootnoteExtension.java
浏览文件 @
e879a0ac
...
...
@@ -9,7 +9,7 @@ import com.vladsch.flexmark.util.data.DataKey;
import
com.vladsch.flexmark.util.data.MutableDataHolder
;
import
com.vladsch.flexmark.util.format.options.ElementPlacement
;
import
com.vladsch.flexmark.util.format.options.ElementPlacementSort
;
import
org.
jetbrains.annotations.Not
Null
;
import
org.
springframework.lang.Non
Null
;
import
run.halo.app.utils.footnotes.internal.FootnoteBlockParser
;
import
run.halo.app.utils.footnotes.internal.FootnoteLinkRefProcessor
;
import
run.halo.app.utils.footnotes.internal.FootnoteNodeFormatter
;
...
...
@@ -63,8 +63,8 @@ public class FootnoteExtension
}
@Override
public
void
extend
(
@No
t
Null
HtmlRenderer
.
Builder
htmlRendererBuilder
,
@No
t
Null
String
rendererType
)
{
public
void
extend
(
@No
n
Null
HtmlRenderer
.
Builder
htmlRendererBuilder
,
@No
n
Null
String
rendererType
)
{
if
(
htmlRendererBuilder
.
isRendererType
(
"HTML"
))
{
htmlRendererBuilder
.
nodeRendererFactory
(
new
FootnoteNodeRenderer
.
Factory
());
}
...
...
@@ -77,7 +77,7 @@ public class FootnoteExtension
}
@Override
public
void
rendererOptions
(
@No
t
Null
MutableDataHolder
options
)
{
public
void
rendererOptions
(
@No
n
Null
MutableDataHolder
options
)
{
}
...
...
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteBlockParser.java
浏览文件 @
e879a0ac
...
...
@@ -16,8 +16,8 @@ import com.vladsch.flexmark.util.sequence.BasedSequence;
import
java.util.Set
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.
jetbrains.annotations.Not
Null
;
import
org.
jetbrains.annotations
.Nullable
;
import
org.
springframework.lang.Non
Null
;
import
org.
springframework.lang
.Nullable
;
import
run.halo.app.utils.footnotes.FootnoteBlock
;
import
run.halo.app.utils.footnotes.FootnoteExtension
;
...
...
@@ -115,9 +115,9 @@ public class FootnoteBlockParser extends AbstractBlockParser {
return
false
;
}
@No
t
Null
@No
n
Null
@Override
public
BlockParserFactory
apply
(
@No
t
Null
DataHolder
options
)
{
public
BlockParserFactory
apply
(
@No
n
Null
DataHolder
options
)
{
return
new
BlockFactory
(
options
);
}
}
...
...
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteLinkRefProcessor.java
浏览文件 @
e879a0ac
...
...
@@ -6,7 +6,7 @@ import com.vladsch.flexmark.util.ast.Document;
import
com.vladsch.flexmark.util.ast.Node
;
import
com.vladsch.flexmark.util.data.DataHolder
;
import
com.vladsch.flexmark.util.sequence.BasedSequence
;
import
org.
jetbrains.annotations.Not
Null
;
import
org.
springframework.lang.Non
Null
;
import
run.halo.app.utils.footnotes.Footnote
;
import
run.halo.app.utils.footnotes.FootnoteBlock
;
import
run.halo.app.utils.footnotes.FootnoteExtension
;
...
...
@@ -33,14 +33,14 @@ public class FootnoteLinkRefProcessor implements LinkRefProcessor {
}
@Override
public
boolean
isMatch
(
@No
t
Null
BasedSequence
nodeChars
)
{
public
boolean
isMatch
(
@No
n
Null
BasedSequence
nodeChars
)
{
return
nodeChars
.
length
()
>=
3
&&
nodeChars
.
charAt
(
0
)
==
'['
&&
nodeChars
.
charAt
(
1
)
==
'^'
&&
nodeChars
.
endCharAt
(
1
)
==
']'
;
}
@No
t
Null
@No
n
Null
@Override
public
Node
createNode
(
@No
t
Null
BasedSequence
nodeChars
)
{
public
Node
createNode
(
@No
n
Null
BasedSequence
nodeChars
)
{
BasedSequence
footnoteId
=
nodeChars
.
midSequence
(
2
,
-
1
).
trim
();
FootnoteBlock
footnoteBlock
=
footnoteId
.
length
()
>
0
?
footnoteRepository
.
get
(
footnoteId
.
toString
())
:
null
;
...
...
@@ -55,39 +55,39 @@ public class FootnoteLinkRefProcessor implements LinkRefProcessor {
return
footnote
;
}
@No
t
Null
@No
n
Null
@Override
public
BasedSequence
adjustInlineText
(
@No
tNull
Document
document
,
@Not
Null
Node
node
)
{
public
BasedSequence
adjustInlineText
(
@No
nNull
Document
document
,
@Non
Null
Node
node
)
{
assert
node
instanceof
Footnote
;
return
((
Footnote
)
node
).
getText
();
}
@Override
public
boolean
allowDelimiters
(
@No
tNull
BasedSequence
chars
,
@Not
Null
Document
document
,
@No
t
Null
Node
node
)
{
public
boolean
allowDelimiters
(
@No
nNull
BasedSequence
chars
,
@Non
Null
Document
document
,
@No
n
Null
Node
node
)
{
return
true
;
}
@Override
public
void
updateNodeElements
(
@No
tNull
Document
document
,
@Not
Null
Node
node
)
{
public
void
updateNodeElements
(
@No
nNull
Document
document
,
@Non
Null
Node
node
)
{
}
public
static
class
Factory
implements
LinkRefProcessorFactory
{
@No
t
Null
@No
n
Null
@Override
public
LinkRefProcessor
apply
(
@No
t
Null
Document
document
)
{
public
LinkRefProcessor
apply
(
@No
n
Null
Document
document
)
{
return
new
FootnoteLinkRefProcessor
(
document
);
}
@Override
public
boolean
getWantExclamationPrefix
(
@No
t
Null
DataHolder
options
)
{
public
boolean
getWantExclamationPrefix
(
@No
n
Null
DataHolder
options
)
{
return
WANT_EXCLAMATION_PREFIX
;
}
@Override
public
int
getBracketNestingLevel
(
@No
t
Null
DataHolder
options
)
{
public
int
getBracketNestingLevel
(
@No
n
Null
DataHolder
options
)
{
return
BRACKET_NESTING_LEVEL
;
}
}
...
...
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteNodeFormatter.java
浏览文件 @
e879a0ac
...
...
@@ -15,8 +15,8 @@ import java.util.HashMap;
import
java.util.HashSet
;
import
java.util.Map
;
import
java.util.Set
;
import
org.
jetbrains.annotations.Not
Null
;
import
org.
jetbrains.annotations
.Nullable
;
import
org.
springframework.lang.Non
Null
;
import
org.
springframework.lang
.Nullable
;
import
run.halo.app.utils.footnotes.Footnote
;
import
run.halo.app.utils.footnotes.FootnoteBlock
;
import
run.halo.app.utils.footnotes.FootnoteExtension
;
...
...
@@ -100,9 +100,9 @@ public class FootnoteNodeFormatter
public
static
class
Factory
implements
NodeFormatterFactory
{
@No
t
Null
@No
n
Null
@Override
public
NodeFormatter
create
(
@No
t
Null
DataHolder
options
)
{
public
NodeFormatter
create
(
@No
n
Null
DataHolder
options
)
{
return
new
FootnoteNodeFormatter
(
options
);
}
}
...
...
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteNodeRenderer.java
浏览文件 @
e879a0ac
...
...
@@ -18,7 +18,7 @@ import java.util.HashSet;
import
java.util.Locale
;
import
java.util.Set
;
import
org.apache.commons.lang3.StringUtils
;
import
org.
jetbrains.annotations.Not
Null
;
import
org.
springframework.lang.Non
Null
;
import
run.halo.app.utils.footnotes.Footnote
;
import
run.halo.app.utils.footnotes.FootnoteBlock
;
import
run.halo.app.utils.footnotes.FootnoteExtension
;
...
...
@@ -53,8 +53,8 @@ public class FootnoteNodeRenderer implements PhasedNodeRenderer {
}
@Override
public
void
renderDocument
(
@No
tNull
NodeRendererContext
context
,
@Not
Null
HtmlWriter
html
,
@No
tNull
Document
document
,
@Not
Null
RenderingPhase
phase
)
{
public
void
renderDocument
(
@No
nNull
NodeRendererContext
context
,
@Non
Null
HtmlWriter
html
,
@No
nNull
Document
document
,
@Non
Null
RenderingPhase
phase
)
{
if
(
phase
==
RenderingPhase
.
BODY_TOP
)
{
if
(
recheckUndefinedReferences
)
{
// need to see if have undefined footnotes that were defined after parsing
...
...
@@ -171,9 +171,9 @@ public class FootnoteNodeRenderer implements PhasedNodeRenderer {
public
static
class
Factory
implements
NodeRendererFactory
{
@No
t
Null
@No
n
Null
@Override
public
NodeRenderer
apply
(
@No
t
Null
DataHolder
options
)
{
public
NodeRenderer
apply
(
@No
n
Null
DataHolder
options
)
{
return
new
FootnoteNodeRenderer
(
options
);
}
}
...
...
src/main/java/run/halo/app/utils/footnotes/internal/FootnoteRepository.java
浏览文件 @
e879a0ac
...
...
@@ -13,7 +13,7 @@ import java.util.Collections;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
org.
jetbrains.annotations.Not
Null
;
import
org.
springframework.lang.Non
Null
;
import
run.halo.app.utils.footnotes.Footnote
;
import
run.halo.app.utils.footnotes.FootnoteBlock
;
import
run.halo.app.utils.footnotes.FootnoteExtension
;
...
...
@@ -79,19 +79,19 @@ public class FootnoteRepository extends NodeRepository<FootnoteBlock> {
super
(
FootnoteExtension
.
FOOTNOTES_KEEP
.
get
(
options
));
}
@No
t
Null
@No
n
Null
@Override
public
DataKey
<
FootnoteRepository
>
getDataKey
()
{
return
FootnoteExtension
.
FOOTNOTES
;
}
@No
t
Null
@No
n
Null
@Override
public
DataKey
<
KeepType
>
getKeepDataKey
()
{
return
FootnoteExtension
.
FOOTNOTES_KEEP
;
}
@No
t
Null
@No
n
Null
@Override
public
Set
<
FootnoteBlock
>
getReferencedElements
(
Node
parent
)
{
HashSet
<
FootnoteBlock
>
references
=
new
HashSet
<>();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录