Skip to content

Improve c/d/hecho text formatting#4240

Merged
vadi2 merged 3 commits intoMudlet:developmentfrom
macjabeth:feature/improved-text-formatting
Nov 5, 2020
Merged

Improve c/d/hecho text formatting#4240
vadi2 merged 3 commits intoMudlet:developmentfrom
macjabeth:feature/improved-text-formatting

Conversation

@macjabeth
Copy link
Copy Markdown
Contributor

@macjabeth macjabeth commented Nov 1, 2020

Brief overview of PR changes/additions

This adds the ability to include other text formatting options in echoes.

At the moment it works like this:

cecho('\n<red>This text <i>should</i> <u>remain</u> red <b>after</b> using these tags.\n')

decho('\n<255,0,0>This text <i>should</i> <u>remain</u> red <b>after</b> using these tags.\n')

hecho('\n#ff0000This text #ishould#/i |uremain|/u red #bafter#/b using these tags.\n')

I'm not super thrilled about the way it looks in hecho, but I tried to keep it consistent. Also as a happy accident this ended up fixing a bug with the reset tag for hecho. It wasn't working for #r beforehand (at least for me) due to some regex parsing issues.

Motivation for adding to Mudlet

It would be great if c/d/hecho could use underline, bold, italics, and so on. Right now all of those functions are limited to colour only.

Other info (issues closed, discussion etc)

Referring to issue #3084.

Now includes <b>, <i>, and <u>.
Now supports <b>, #b, <i>, #i, <u>, #u...
@macjabeth macjabeth requested a review from a team November 1, 2020 03:33
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Nov 1, 2020

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

Copy link
Copy Markdown
Member

@demonnic demonnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to do what it says on the tin

image

@keneanung
Copy link
Copy Markdown
Member

Could you add some Unit Tests for these new features? They are located at https://github.com/Mudlet/Mudlet/tree/875b74f5f580327755c69d6c31b211a5ab503c18/src/mudlet-lua/tests

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well. Could you look into adding the tests?

@vadi2 vadi2 assigned demonnic and unassigned macjabeth Nov 5, 2020
@demonnic
Copy link
Copy Markdown
Member

demonnic commented Nov 5, 2020

image

@vadi2 vadi2 merged commit e311cc7 into Mudlet:development Nov 5, 2020
@macjabeth macjabeth deleted the feature/improved-text-formatting branch November 5, 2020 21:21
@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Nov 8, 2020

Could you update the docs for this?

@breakone9r
Copy link
Copy Markdown

hh boy. just updated to the latest dev as of last night... I have trigger problems with selectString() now...
[4:53 PM] broke-it-again-one9r: looks like it may actually be copy2decho
[4:57 PM] broke-it-again-one9r: This no longer seems to work:
copy2decho(matches[1])
[4:58 PM] broke-it-again-one9r: let me see if it's also broken on the release. gimme a sec
[5:01 PM] broke-it-again-one9r: no. it works in release. soooo...

@breakone9r
Copy link
Copy Markdown

could this change have affected this?

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Nov 12, 2020

This one is OK, I've traced it to f94a494.

Chris7 pushed a commit to Chris7/Mudlet that referenced this pull request Jan 2, 2022
* improve cecho text formatting

Now includes <b>, <i>, and <u>.

* improve d/hecho text formatting

Now supports <b>, #b, <i>, #i, <u>, #u...

* Add unit tests for text formatting
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

Successfully merging this pull request may close these issues.

5 participants