Changes between Version 38 and Version 39 of DeveloperGuidelines/CodeConventions
- Timestamp:
- 11/16/13 23:27:58 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/CodeConventions
v38 v39 24 24 === Quotes === 25 25 26 - for string constants in Pythonuse double-quotes {{{" "}}} - UNLESS the string contains "27 - for string constants in !JavaScriptuse single-quotes {{{' '}}} - UNLESS the string contains a '26 - for string constants in '''Python''' use double-quotes {{{" "}}} - UNLESS the string contains " 27 - for string constants in '''!JavaScript''' use single-quotes {{{' '}}} - UNLESS the string contains a ' 28 28 29 - for Inline-!JavaScriptor JSON inside Python code use {{{''' '''}}} with single-quotes30 - in all other cases of triple-quoted strings (such as docstringsor Inline-XML) use {{{""" """}}} with double-quotes29 - for '''Inline-!JavaScript''' or JSON inside Python code use {{{''' '''}}} with single-quotes 30 - in all other cases of triple-quoted strings (such as '''Docstrings''' or Inline-XML) use {{{""" """}}} with double-quotes 31 31 32 32 - for XML/HTML attributes use double-quotes {{{" "}}} (inner quotes must be escaped anyway) … … 37 37 inline_javascript = '''sometext="%s";''' % sometext 38 38 }}} 39 is a potential bug- the !JavaScript breaks when {{{sometext}}} contains a {{{"}}}.39 is a '''potential bug''' - the !JavaScript breaks when {{{sometext}}} contains a {{{"}}}. 40 40 41 41 A safer way to do that is: