Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Text Mesh Pro ALL Tag closeout Tag?

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by joedurb, Oct 10, 2019 at 2:53 PM.

  1. joedurb

    joedurb

    Joined:
    Nov 13, 2013
    Posts:
    35
    It would be SUPER convenient to have a Markup tag which can clear all existing tag effects.
    So that any place with shared content, where different users provide different lines, I can easily prevent "Style bleed" I.e.:

    Bob says <B> I like things bold <I> and bold italic'd!
    Suzy just wants normal text.

    I would love to be able to place a <ResetTags> or <cleartags> or <closeall> or </all> or simply </> Tag right before Suzy's text.
    As It stands I believe I need to search for every tag possibly used in bob's line, and sort if closed or not, and then add </B></I>

    Or simply spam all of the closing tags at the end of each line. </color></b></i></size> ,etc.
    Anything like this exist? or a simpler workaround?
     
    Last edited: Oct 10, 2019 at 3:44 PM
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,306
    Can you provide more insight on the use case?

    For instance, is this part of a chat system where a user would type some line of text where they would be unlikely to close them. You then take these lines and append them to some list where these un-closed tags become an issue?
     
  3. joedurb

    joedurb

    Joined:
    Nov 13, 2013
    Posts:
    35
    some of our mixed-user interfaces are protected by using separate TMP instances. But We have other systems,
    like a group message board. physically displaying the text in our world, one posting after the other for efficiency. where we allow them to use basic tags. but if they fail to cleanup , spills into next article.

    TUESDAY Oct 8:
    bob typed this text <B>loud text.
    </CLEAR>
    WEDNESDAY Oct 1:
    Sally doesnt want this to be bold.

    If I could Clear all tag effects at the </CLEAR> would have simplified this issue.
    Just thought you might handily be able to reset all markedup stuff easily, and hoped there was already a way. a Blank Style?

    Just being lazy probably. searching for all unclosed tags i guess is just (and case insensitivity added):
    if (text.strpos("<B>") > text.strpos("<B>")) text+="</B>";

    But I would think it could be a handy feature to simply return the formatting to the TMP box's original specs.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,306
    I'll try taking a look at this over the new few days / weekend and let you know what I come up with.