Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rich text from markdown can get newlines wrong #2589

Closed
drognisep opened this issue Oct 26, 2021 · 5 comments
Closed

Rich text from markdown can get newlines wrong #2589

drognisep opened this issue Oct 26, 2021 · 5 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working

Comments

@drognisep
Copy link
Contributor

Describe the bug:

I was following the youtube video here to make a markdown editor, and I noticed that when adding exclamation points in a header, like in "Hello!!!", the first is put on the next line, while the second and third are added to the header.

To Reproduce:

Steps to reproduce the behaviour:

Type the text as shown into the editor panel on the left.

Screenshots:

image

Example code:

This is the code I used to create the HSplit markdown editor. Pretty much exactly what was shown in the video except for window sizing.

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("Markdown editor")
	w.Resize(fyne.NewSize(640, 480))

	edit := widget.NewMultiLineEntry()
	rich := widget.NewRichTextFromMarkdown("")
	edit.OnChanged = rich.ParseMarkdown

	w.SetContent(container.NewHSplit(edit, rich))
	w.ShowAndRun()
}

Device (please complete the following information):

  • OS: Windows 10
  • Version: 21H1, build 19043.1288
  • Go version: 1.16 windows/amd64
  • Fyne version: (from go.mod) fyne.io/fyne/v2 v2.1.1
@drognisep drognisep added the unverified A bug that has been reported but not verified label Oct 26, 2021
@stuartdd
Copy link

Hi. I have similar issues.

Also I cannot find what markdown is currently supported. Tables? Syntax Hi-lighting for code fences?

This would be a really, really useful tool if it was working properly.

Stuart

Screenshot from 2021-10-26 15-33-40

OS: Linux Mint 20.2 Cinnamon
Linux Kernel: 5.4.0-89-generic
Go version: 1.17
Fyne version: (from go.mod) fyne.io/fyne/v2 v2.1.1

@andydotxyz
Copy link
Member

Tables? Syntax Hi-lighting for code fences?

These are not part of the core Markdown spec, we may add them in the future

@andydotxyz andydotxyz added blocker Items that would block a forthcoming release bug Something isn't working and removed unverified A bug that has been reported but not verified labels Oct 26, 2021
@andydotxyz andydotxyz added this to the Fixes (v2.1.x) milestone Oct 26, 2021
@andydotxyz andydotxyz changed the title Odd rich text from markdown behavior Rich text from markdown can get newlines wrong Oct 27, 2021
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Oct 27, 2021
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Oct 27, 2021
@andydotxyz
Copy link
Member

both items fixed on develop branch :)

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Nov 15, 2021
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Nov 15, 2021
@jfjensen
Copy link

If I run the above example code and type in **hello** then no emphasis is added. The emphasis only appears when I add another *. I tried looking into this myself but I'm not familiar with the inner workings of the Markdown Renderer.

Screen Shot 05-13-22 at 10 40 PM

@andydotxyz
Copy link
Member

This issue is closed @jfjensen - please open a new one

d4x1 added a commit to d4x1/fyne that referenced this issue Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants