Correct multi-line string example

XMLWordPrintableJSON

    • Type: Change Request
    • Resolution: Persuasive
    • Priority: Medium
    • Shorthand (FHIR)
    • 0.12.0 [deprecated]
    • FHIR Infrastructure
    • Language Reference
    • Hide

      The example and counter-example both produce the same output. However, the example has a cleaner format in FSH.  We will add a fuller explanation, as follows.
       
      While line breaks are supported using conventional strings, FSH also supports slightly different processing for strings demarcated with three double quotation marks `"""`. This feature can help authors to maintain consistent indentation in the FSH file.

      As an example, an author might use a multi-line string to write markdown so that the markdown is neatly indented:

      ```
      * ^purpose = """
          * This profile is intended to support workflows where:
            * this happens; or
            * that happens
          * This profile is not intended to support workflows where:
            * nothing happens
        """
      ```

      Using a single-quoted string requires the following spacing to accomplish the same markdown formatting:

      ```
       ^purpose = " This profile is intended to support workflows where:
        * this happens; or
        * that happens
      * This profile is not intended to support workflows where:
        * nothing happens"
      ```

      The difference between these two approaches is that the latter obscures the fact that the first and fourth line are at the same indentation level, and makes it appear there are two rules because of the asterisk in the first column. The former approach allows the first line to be empty so the string is defined as a block, and allows the entire block to be indented, so visually, it does not appear a second rule is involved.

      Show
      The example and counter-example both produce the same output. However, the example has a cleaner format in FSH .  We will add a fuller explanation, as follows.   While line breaks are supported using conventional strings, FSH also supports slightly different processing for strings demarcated with three double quotation marks `"""`. This feature can help authors to maintain consistent indentation in the FSH file. As an example, an author might use a multi-line string to write markdown so that the markdown is neatly indented: ``` * ^purpose = """     * This profile is intended to support workflows where:       * this happens; or       * that happens     * This profile is not intended to support workflows where:       * nothing happens   """ ``` Using a single-quoted string requires the following spacing to accomplish the same markdown formatting: ```  ^purpose = "  This profile is intended to support workflows where:   * this happens; or   * that happens * This profile is not intended to support workflows where:   * nothing happens" ``` The difference between these two approaches is that the latter obscures the fact that the first and fourth line are at the same indentation level, and makes it appear there are two rules because of the asterisk in the first column. The former approach allows the first line to be empty so the string is defined as a block, and allows the entire block to be indented, so visually, it does not appear a second rule is involved.
    • Moesel/Rhodes 11-0-1
    • Clarification
    • Non-substantive

      The specification indicates that multi-line strings simplify, which is great, but it gives a counter-example that at first glance appears to be simpler. Is there some escaping that isn't happening in the counter-example? It looks like it's probably incorrect.

      Existing Wording:

      Multi-line Strings:

            Assignee:
            Unassigned
            Reporter:
            Bryn Rhodes
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: