r100981 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100980‎ | r100981 | r100982 >
Date:15:16, 27 October 2011
Author:tparscal
Status:ok
Tags:
Comment:
Using empty array instead of false for no elements can be nested, using 2 falsey magic values was looking too scary
Modified paths:
  • /trunk/parsers/wikidom/lib/hype/models/es.DocumentModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/models/es.ListItemModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/models/es.ParagraphModel.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/hype/models/es.DocumentModel.js
@@ -38,14 +38,13 @@
3939 *
4040 * Each rule is an object with a parents and children property. Each of these properties may contain
4141 * one of three possible values:
42 - * Array - List of allowed element types
 42+ * Array - List of allowed element types (if empty, no elements will be allowed)
4343 * Null - Any element type is allowed (as long as the other element also allows it)
44 - * Boolean False - No elements are allowed (used for nodes that can not have children)
4544 *
4645 * @example Paragraph rules
4746 * {
4847 * 'parents': null,
49 - * 'children': false
 48+ * 'children': []
5049 * }
5150 * @example List rules
5251 * {
@@ -55,7 +54,7 @@
5655 * @example ListItem rules
5756 * {
5857 * 'parents': ['list'],
59 - * 'children': false
 58+ * 'children': []
6059 * }
6160 */
6261 es.DocumentModel.nodeRules = {};
Index: trunk/parsers/wikidom/lib/hype/models/es.ParagraphModel.js
@@ -27,5 +27,5 @@
2828
2929 es.DocumentModel.nodeRules.paragraph = {
3030 'parents': null,
31 - 'children': false
 31+ 'children': []
3232 };
Index: trunk/parsers/wikidom/lib/hype/models/es.ListItemModel.js
@@ -27,5 +27,5 @@
2828
2929 es.DocumentModel.nodeRules.listItem = {
3030 'parents': ['list'],
31 - 'children': false
 31+ 'children': []
3232 };

Status & tagging log