Ignore:
Timestamp:
2021-12-10T14:22:20+13:00 (2 years ago)
Author:
cstephen
Message:

Fix direct input formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/atea/macron-restoration/src/components/DirectInput.vue

    r35772 r35796  
    88        <span v-if="errorState" class="error-text">{{ translations.get('DirectInput_UnknownError') }}</span>
    99
    10         <span class="preserveWhitespace" v-html="formattedRestored" />
     10        <span class="preserveWhitespace" v-html="htmlFormattedRestored" />
    1111    </div>
    1212
     
    113113            }
    114114        },
    115         formattedRestored() {
     115        htmlFormattedRestored() {
    116116            let restored = "";
    117117
     
    135135            }
    136136
    137             return restored;
     137            return restored.trim();
     138        },
     139        formattedRestored() {
     140            let restored = "";
     141
     142            for (const word of this.restored) {
     143                if (word.w) {
     144                    if (word[0] !== "-") {
     145                        restored += " ";
     146                    }
     147
     148                    restored += word.w;
     149                }
     150
     151                if (word.linebreaks) {
     152                    restored += this.normaliseLinebreak(word.linebreaks);
     153                }
     154            }
     155
     156            return restored.trim();
    138157        },
    139158        ...mapState({
Note: See TracChangeset for help on using the changeset viewer.