question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configure default line width for string widget

See original GitHub issue

Is your feature request related to a problem? Please describe. The YAML library that the CMS uses has a default line width of 80 when writing content to front matter (may apply in other cases). This causes an issue when using the string widget as it inserts a newline at the 80 character mark but does not use YAML folding, so plain text is inserted on its own line. This is known to break site builds on Hugo, Pelican, and probably others: Error: Error building site: "site/content/author/author-name/index.md:6:1": failed to unmarshal YAML: yaml: line 5: could not find expected ':'

Workarounds include switching to the text widget or using a max character count, but we shouldn’t need to do that.

Describe the solution you’d like Remove the line wrapping feature or disable it on strings. It feels like an opinionated way of making your code look pretty when many people have other ways of doing this, ex: Prettier on VSC (which coincidentally has the same default, but won’t break the YAML structure).

I think this won’t happen based on feedback from @erezrokah on breaking existing content, but the full impact hasn’t been explored yet.

Describe alternatives you’ve considered

  1. Implement YAML folding to keep this feature but not have it break sites. Seems like it’d be very easy
  2. Allow configuration on the string widget to remove or increase the limit

Additional context Original forum post: String fields have newlines added to Markdown front matter

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
erezrokahcommented, Jul 25, 2021

But for strings this wouldn’t be an issue right?

True - we’ll need to make sure we only quote strings (or use the > format).

0reactions
timtorrescommented, Jul 25, 2021

We have to be careful with quoting and make sure we’re not losing any type information (e.g. dates/numbers).

But for strings this wouldn’t be an issue right?

Can you test if your site generator handles it?

Yep this works exactly how the result shows 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the thickness of HLine/VLine in Qt Designer
1 Answer 1 · set the frameShadow to Sunken or Raised · set the lineWidth to zero (this is needed so as to...
Read more >
8.10. Canvas line objects - a GUI for Python
The line's width. Default is 1 pixel. See Section 5.1, “Dimensions” for possible values. Next: 8.11.
Read more >
GetMetricWidgetImage: Metric Widget Structure and Syntax
The default is timeSeries . The width of the widget in pixels. The default is 600. Required: No, but you should set this...
Read more >
WIDGET_TEXT - L3HarrisGeospatial.com
The height of the widget in text lines. Note that the physical height of the text widget depends on both the value of...
Read more >
Label Widget (Themable) - PTC Support
Property Name Description Base Type Default Value Bindable... MaxHeight NUMBER n/a N LabelText The text that is displayed as the label. STRING n/a Y
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found