diff options
Diffstat (limited to 'platform/android/scripts/generate-style-code.js')
-rwxr-xr-x | platform/android/scripts/generate-style-code.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js index 05ca957974..b435351df5 100755 --- a/platform/android/scripts/generate-style-code.js +++ b/platform/android/scripts/generate-style-code.js @@ -235,10 +235,15 @@ global.propertyValueDoc = function (property, value) { // Match references to other property names & values. // Requires the format 'When `foo` is set to `bar`,'. - let doc = property.values[value].doc.replace(/When `(.+?)` is set to `(.+?)`,/g, function (m, peerPropertyName, propertyValue, offset, str) { + let doc = property.values[value].doc.replace(/When `(.+?)` is set to `(.+?)`(?: or `([^`]+?)`)?,/g, function (m, peerPropertyName, propertyValue, secondPropertyValue, offset, str) { let otherProperty = snakeCaseUpper(peerPropertyName); let otherValue = snakeCaseUpper(peerPropertyName) + '_' + snakeCaseUpper(propertyValue); - return 'When {@link ' + `${otherProperty}` + '} is set to {@link Property#' + `${otherValue}` + '},'; + const firstPropertyValue = 'When {@link ' + `${otherProperty}` + '} is set to {@link Property#' + `${otherValue}` + '}'; + if (secondPropertyValue) { + return firstPropertyValue + ` or {@link Property#${snakeCaseUpper(peerPropertyName) + '_' + snakeCaseUpper(secondPropertyValue)}},`; + } else { + return firstPropertyValue + ','; + } }); // Match references to our own property values. |