Yanfly MessageCore WordWrap Spacing Issues

Discussion in 'Javascript/Plugin Support' started by dragoonkain, Oct 27, 2015.

  1. dragoonkain

    dragoonkain Villager Member

    Likes Received:
    First Language:
    I've been encountering a lot of places where turning on WordWrap in YanFly MessageCore is resulting in words being glued together.


    I have been able to correct this issue with the following code.

    Window_Base.prototype.setWordWrap = function(text) { this._wordWrap = false; if (text.match(/<(?:WordWrap)>/i)) { this._wordWrap = true; text = text.replace(/<(?:WordWrap)>/gi, '\n'); } if (this._wordWrap) { text = text.replace(/^[\n\r]/, ''); text = text.replace(/(?!^) [\n\r]/g, ''); text = text.replace(/(?!^)[\n\r]+/g, ' '); // text = text.replace(/[\n\r]+/g, ''); text = text.replace(/<(?:BR|line break)>/gi, '\n'); } return text;};I was hoping someone out there might know what the issue is (if I can prevent it from happening) and/or if the fix could be consolidated to not needing 3 regexes. 

Share This Page