From 132954b56340ff6d883a325c0f64ed7ce1aa3072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 30 Sep 2016 18:20:47 -0700 Subject: [PATCH] [ios, macos] Loosened style doc transform regex (#6543) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mildly decoupled the transformation from the style specification to the format required for iOS/macOS documentation so it’s harder for style specification references to other properties’ values to fall through the cracks. Fixes #6541. --- platform/darwin/scripts/generate-style-code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index 7fca6021d..a801145de 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -86,10 +86,10 @@ global.testHelperMessage = function (property, layerType, isFunction) { global.propertyDoc = function (propertyName, property, layerType) { // Match references to other property names & values. // Requires the format 'When `foo` is set to `bar`,'. - let doc = property.doc.replace(/When `(.+?)` is set to `(.+?)`,/g, function (m, peerPropertyName, propertyValue, offset, str) { + let doc = property.doc.replace(/`([^`]+?)` is set to `([^`]+?)`/g, function (m, peerPropertyName, propertyValue, offset, str) { let otherProperty = camelizeWithLeadingLowercase(peerPropertyName); let otherValue = objCType(layerType, peerPropertyName) + camelize(propertyValue); - return 'When `' + `${otherProperty}` + '` is set to `' + `${otherValue}` + '`,'; + return '`' + `${otherProperty}` + '` is set to `' + `${otherValue}` + '`'; }); // Match references to our own property values. // Requires the format 'is equivalent to `bar`'.