Special char & not treated ok when auto-quoting emit.
A key having an ampersand in it does not trigger quoting in the emit, when auto-quoting is enabled.
This commit is contained in:
parent
bd58664e8d
commit
31e159167e
@ -176,11 +176,11 @@ bool IsValidPlainScalar(const std::string& str, FlowType::value flowType,
|
|||||||
static const RegEx& disallowed_flow =
|
static const RegEx& disallowed_flow =
|
||||||
Exp::EndScalarInFlow() | (Exp::BlankOrBreak() + Exp::Comment()) |
|
Exp::EndScalarInFlow() | (Exp::BlankOrBreak() + Exp::Comment()) |
|
||||||
Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() |
|
Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() |
|
||||||
Exp::Tab();
|
Exp::Tab() | Exp::Ampersand();
|
||||||
static const RegEx& disallowed_block =
|
static const RegEx& disallowed_block =
|
||||||
Exp::EndScalar() | (Exp::BlankOrBreak() + Exp::Comment()) |
|
Exp::EndScalar() | (Exp::BlankOrBreak() + Exp::Comment()) |
|
||||||
Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() |
|
Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() |
|
||||||
Exp::Tab();
|
Exp::Tab() | Exp::Ampersand();
|
||||||
const RegEx& disallowed =
|
const RegEx& disallowed =
|
||||||
flowType == FlowType::Flow ? disallowed_flow : disallowed_block;
|
flowType == FlowType::Flow ? disallowed_flow : disallowed_block;
|
||||||
|
|
||||||
|
|||||||
@ -117,6 +117,10 @@ inline const RegEx& ValueInJSONFlow() {
|
|||||||
static const RegEx e = RegEx(':');
|
static const RegEx e = RegEx(':');
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
inline const RegEx& Ampersand() {
|
||||||
|
static const RegEx e = RegEx('&');
|
||||||
|
return e;
|
||||||
|
}
|
||||||
inline const RegEx Comment() {
|
inline const RegEx Comment() {
|
||||||
static const RegEx e = RegEx('#');
|
static const RegEx e = RegEx('#');
|
||||||
return e;
|
return e;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user