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

Allow line breaks in node labels (or create a terminal node function) #1

Open
amunn opened this issue Jan 7, 2022 · 3 comments
Open

Comments

@amunn
Copy link

amunn commented Jan 7, 2022

Hi thanks for writing this. It's syntactically incorrect for there to be a branch between the terminal node label and the terminal node word and many of us who teach syntax try to enforce this. Would it be possible to allow line breaks in node labels so that D\\the would be represented as D with 'the' below it? Alternatively I suppose you could create a terminal node function to add the word to any node.

@groverburger
Copy link
Owner

Thanks for bringing this up, yep this should be doable. Apologies for the late response, I've been very busy. I'll have time to implement this in about a month, but if you want to create a fork and a pull request for this feature that would be very helpful.

@amunn
Copy link
Author

amunn commented Mar 3, 2022

I've had a look at the code, but it's pretty sparsely documented :) , so I'm not quite sure where this would be done. But I'm not in a hurry really.

@amunn
Copy link
Author

amunn commented Mar 3, 2022

Inserting newlines in the getMainTextAndSubText function works, but there needs to be a way to keep track of the maximum width of each line for the box calculation otherwise the box grows to the width of the text if the newlines weren't there. The height of the box also needs to adapt to the newlines too. I'm not sure I understand your code well enough to make that all work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants