mirror of
https://github.com/google/blockly.git
synced 2026-01-11 02:47:09 +01:00
feat: make generator quoting methods public (#7392)
* feat: make quoting methods public * feat: add quote and multilineQuote methods * fix: update code generators to use new methods * chore: remove aliases * chore: revert changes to generators
This commit is contained in:
@@ -228,7 +228,6 @@ export class PythonGenerator extends CodeGenerator {
|
||||
* Encode a string as a properly escaped Python string, complete with quotes.
|
||||
* @param {string} string Text to encode.
|
||||
* @return {string} Python string.
|
||||
* @protected
|
||||
*/
|
||||
quote_(string) {
|
||||
string = string.replace(/\\/g, '\\\\').replace(/\n/g, '\\\n');
|
||||
@@ -250,7 +249,6 @@ export class PythonGenerator extends CodeGenerator {
|
||||
* with quotes.
|
||||
* @param {string} string Text to encode.
|
||||
* @return {string} Python string.
|
||||
* @protected
|
||||
*/
|
||||
multiline_quote_(string) {
|
||||
const lines = string.split(/\n/g).map(this.quote_);
|
||||
|
||||
Reference in New Issue
Block a user