mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 17:56:32 +00:00
Add CircularReference constructor to LogMessage.
This commit is contained in:
@@ -61,6 +61,7 @@ data LogMessage =
|
||||
| DuplicateLinkReference String SourcePos
|
||||
| DuplicateNoteReference String SourcePos
|
||||
| ReferenceNotFound String SourcePos
|
||||
| CircularReference String SourcePos
|
||||
| ParsingUnescaped String SourcePos
|
||||
| CouldNotLoadIncludeFile String SourcePos
|
||||
| ParsingTrace String SourcePos
|
||||
@@ -106,6 +107,12 @@ instance ToJSON LogMessage where
|
||||
"source" .= Text.pack (sourceName pos),
|
||||
"line" .= toJSON (sourceLine pos),
|
||||
"column" .= toJSON (sourceColumn pos)]
|
||||
CircularReference s pos ->
|
||||
["type" .= String "CircularReference",
|
||||
"contents" .= Text.pack s,
|
||||
"source" .= Text.pack (sourceName pos),
|
||||
"line" .= toJSON (sourceLine pos),
|
||||
"column" .= toJSON (sourceColumn pos)]
|
||||
ParsingUnescaped s pos ->
|
||||
["type" .= String "ParsingUnescaped",
|
||||
"contents" .= Text.pack s,
|
||||
@@ -176,6 +183,8 @@ showLogMessage msg =
|
||||
"Duplicate note reference '" ++ s ++ "' at " ++ showPos pos
|
||||
ReferenceNotFound s pos ->
|
||||
"Reference not found for '" ++ s ++ "' at " ++ showPos pos
|
||||
CircularReference s pos ->
|
||||
"Circular reference '" ++ s ++ "' at " ++ showPos pos
|
||||
ParsingUnescaped s pos ->
|
||||
"Parsing unescaped '" ++ s ++ "' at " ++ showPos pos
|
||||
CouldNotLoadIncludeFile fp pos ->
|
||||
@@ -208,6 +217,7 @@ messageVerbosity msg =
|
||||
DuplicateLinkReference{} -> WARNING
|
||||
DuplicateNoteReference{} -> WARNING
|
||||
ReferenceNotFound{} -> WARNING
|
||||
CircularReference{} -> WARNING
|
||||
CouldNotLoadIncludeFile{} -> WARNING
|
||||
ParsingUnescaped{} -> INFO
|
||||
ParsingTrace{} -> DEBUG
|
||||
|
||||
Reference in New Issue
Block a user