Correctly escape strings if needed and check for it
This commit is contained in:
@@ -15,6 +15,10 @@ func (p *PlainText) Check() error {
|
||||
return errors.New("type attribute of plain text must be text or html if not omitted")
|
||||
}
|
||||
|
||||
if p.Type == "html" && !isCorrectlyEscaped(p.Text) {
|
||||
return errors.New("text element of plain text not correctly escaped")
|
||||
}
|
||||
|
||||
if p.Text == "" {
|
||||
return errors.New("text element of plain text empty")
|
||||
}
|
||||
|
Reference in New Issue
Block a user