From 590b8052fe176ae812b4baaf619cbd147ccd5e87 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Fri, 1 Sep 2017 14:50:50 +0200 Subject: [PATCH] docs(core): improve formatting for the preserveWhitespaces option (#18995) PR Close #18995 --- packages/core/src/metadata/directives.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/core/src/metadata/directives.ts b/packages/core/src/metadata/directives.ts index 53a17ced0d..f2dc5d9e13 100644 --- a/packages/core/src/metadata/directives.ts +++ b/packages/core/src/metadata/directives.ts @@ -678,7 +678,7 @@ export interface Component extends Directive { entryComponents?: Array|any[]>; /** - * If {@link Component#preserveWhitespaces `Component.preserveWhitespaces`} is set to `false` + * If {@link Component#preserveWhitespaces Component.preserveWhitespaces} is set to `false` * potentially superfluous whitespace characters (ones matching the `\s` character class in * JavaScript regular expressions) will be removed from a compiled template. This can greatly * reduce AOT-generated code size as well as speed up view creation. @@ -720,14 +720,24 @@ export interface Component extends Directive { * * will be compiled to the equivalent of: * - * * ```html + * ```html * Spaces between links. * ``` * * Please note that sequences of `&ngsp;` are still collapsed to just one space character when - * the `preserveWhitespaces` option is set to `false` (ex.: - * `before&ngsp;&ngsp;&ngsp;after` would be equivalent to - * `before after`). The `&ngsp;` pseudo-entity is useful for forcing presence of + * the `preserveWhitespaces` option is set to `false`. Ex.: + * + * ```html + * before&ngsp;&ngsp;&ngsp;after + * ``` + * + * would be equivalent to: + * + * ```html + * before after + * ``` + * + * The `&ngsp;` pseudo-entity is useful for forcing presence of * one space (a text node having `&ngsp;` pseudo-entities will never be removed), but it is not * meant to mark sequences of whitespace characters. The previously described * `ngPreserveWhitespaces` attribute is more useful for preserving sequences of whitespace