If this is an HTML template, then set the non-HTML content to be the stripped version of the HTML.
        If this is a plain text template, then set the HTML content to be null.
163171
def save(self, *args, **kwargs):
        '''
        
        '''
        if self.send_html:
            self.content = get_text_for_html(self.html_content)
        else:
            self.html_content = None

        super(EmailTemplate, self).save(*args, **kwargs)
563658
private boolean isHtml() {
        StaplerRequest req = Stapler.getCurrentRequest();
        return req!=null && req.getAttribute("html")!=null;
    }
12107
function(content){
			if (typeof content === 'string') {  //$NON-NLS-0$
				this._contentParent.innerHTML = content;
			} else {
				this._contentParent.innerHTML = ""; //NON-NLS-0$
				this._contentParent.appendChild(content);
			}
		}
1160776
def set_content(self, content):
        
        if self.allows_content:
            self.content = content.strip()
        else:
            raise UNTLStructureException(
                'Element "%s" does not allow textual content' % (self.tag,)
            )
421750
function nullCharacterInForeignContent(p, token) {
    token.chars = UNICODE.REPLACEMENT_CHARACTER;
    p._insertCharacters(token);
}
1364799
public void setEmpty ()
  {
    m_sValue = "";
    m_nLeading = 0;
    m_nTrailing = 0;
    m_bIsEmpty = true;
    if (m_aNext != null)
      m_aNext.m_bPrevEmpty = true;
  }
370310
function prepareTemplate(html) {

        var ESCAPE_STRING = /\s{2,}/g ,
            ESCAPE_CARRIAGE = /(\r)|(\n)|(\r\n)/g;

        return html.replace(ESCAPE_STRING, ' ').replace(ESCAPE_CARRIAGE, '');
    }
391926
public static String stripHtml(String html) {

        if (html == null) {
            return null;
        }
        Element el = DOM.createDiv();
        el.setInnerHTML(html);
        return el.getInnerText();
    }
528281
public void setHtml(String html) {
        this.html = html;

        if (widget != null) {
            if (widget.isAttached()) {
                tooltipElement.find("span")
                        .html(html != null ? html : "");
            } else {
                widget.addAttachHandler(event ->
                        tooltipElement.find("span")
                                .html(html != null ? html : ""));
            }
        } else {
            GWT.log("Please initialize the Target widget.", new IllegalStateException());
        }
    }
1106870
function (container, templateCtxt) {
            var contentSearch = null, i, l;
            for (i = 0, l = container.length; i < l; i++) {
                var description = container[i];
                if (description.templateCtxt == templateCtxt) {
                    return description;
                } else {
                    contentSearch = this._findTemplateDes(description.content, templateCtxt);
                    if (contentSearch) {
                        return contentSearch;
                    }
                }
            }
            return null;
        }
585942
public void deleteTemplate(DeleteTemplateRequest request) {
        checkNotNull(request, "object request should not be null.");
        assertStringNotNullOrEmpty(request.getTemplateId(), "object templateId should not be null or empty.");

        InternalRequest internalRequest =
                this.createRequest("template", request, HttpMethodName.DELETE, request.getTemplateId());
        this.invokeHttpClient(internalRequest, SmsResponse.class);
    }
577393
public static boolean renderHTMLStringPreserveEmptyAttribute(ResponseWriter writer,
            String componentProperty, String htmlAttrName, String value)
            throws IOException
    {
        if (!isDefaultStringPreserveEmptyAttributeValue(value))
        {
            writer.writeAttribute(htmlAttrName, value, componentProperty);
            return true;
        }
        return false;
    }
1343819
function text(el, contents) {
  if (el.textContent) {
    el.textContent = contents;
  } else {
    el.innerText = contents;
  }
}
804704
function () {
      this.removeChildInstances();

      if (this.template) {
        var args = this.getTemplateArguments();

        // temporarily assign a new node to get the content in a doc fragment
        var realNode = this.node;
        var df = doc.createDocumentFragment();
        this.node = df;
        this.template.call(this, args);

        realNode.insertBefore(df, this.node2);
        this.replaceNodeBy(df , realNode); // recursively remove doc fragment reference
        // now this.node=realNode
        this.isDOMempty = false;
      }
  }
1016950
public static HtmlTree A(HtmlVersion htmlVersion, String attr, Content body) {
        HtmlTree htmltree = new HtmlTree(HtmlTag.A);
        htmltree.addAttr((htmlVersion == HtmlVersion.HTML4)
                ? HtmlAttr.NAME
                : HtmlAttr.ID,
                nullCheck(attr));
        htmltree.addContent(nullCheck(body));
        return htmltree;
    }
87457
function detectTemplateId( HTMLCode ){

    var commentTagPattern = /<!--\s*InstanceBegin\s+template="\/([^"]+)"\s*[^>]*-->/,
        matchingResult = HTMLCode.match( commentTagPattern );

    if( matchingResult ){
        return matchingResult[1];
    }
    else {
        return null;
    }
}
683537
protected void checkTemplate() {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_simpleFieldFolderName.getValue())) {
            return;
        }
        if (!m_clonedCms.existsResource(getSiteRoot())) {
            return;
        }
        try {
            String templateValue = m_clonedCms.readPropertyObject(
                getSiteRoot(),
                CmsPropertyDefinition.PROPERTY_TEMPLATE,
                false).getValue();
            m_simpleFieldTemplate.addItem(templateValue);
            m_simpleFieldTemplate.setValue(templateValue);
        } catch (CmsException e) {
            //
        }
    }