diff --git a/etc/turtle.html b/etc/turtle.html index 4c86e53..a9f59ea 100644 --- a/etc/turtle.html +++ b/etc/turtle.html @@ -24,13 +24,13 @@ [4] prefixID ::= - "@prefix" PNAME_NS IRIREF "." + "@prefix" PNAME_NS IRIREF "." [5] base ::= - "@base" IRIREF "." + "@base" IRIREF "." [28s] @@ -114,13 +114,13 @@ [128s] RDFLiteral ::= - String (LANGTAG | ("^^" iri))? + String (LANGTAG | ("^^" iri))? [133s] BooleanLiteral ::= - "true" | "false" + "true" | "false" [17] @@ -173,7 +173,7 @@ [141s] BLANK_NODE_LABEL ::= - "_:" (PN_CHARS_U | [0-9]) ((PN_CHARS | ".")* PN_CHARS)? + "_:" (PN_CHARS_U | [0-9]) ((PN_CHARS | ".")* PN_CHARS)? [144s] @@ -221,13 +221,13 @@ [24] STRING_LITERAL_LONG_SINGLE_QUOTE ::= - "'''" (("'" | "''")? ([^'\] | ECHAR | UCHAR))* "'''" + "'''" (("'" | "''")? ([^'\] | ECHAR | UCHAR))* "'''" [25] STRING_LITERAL_LONG_QUOTE ::= - '"""' (('"' | '""')? ([^"\] | ECHAR | UCHAR))* '"""' + '"""' (('"' | '""')? ([^"\] | ECHAR | UCHAR))* '"""' [26] diff --git a/lib/ebnf/writer.rb b/lib/ebnf/writer.rb index 2656949..edbd955 100644 --- a/lib/ebnf/writer.rb +++ b/lib/ebnf/writer.rb @@ -351,8 +351,8 @@ def format_ebnf_string(string, quote = '"') end end - res = "#{quote}#{string}#{quote}" - @options[:html] ? @coder.encode(res) : res + res = @options[:html] ? %(#{@coder.encode(string)}) : string + res = "#{quote}#{res}#{quote}" end def escape_ebnf_hex(u)