Unwanted element appear when using Decoration.replace (codemirror v6) - codemirror

After using Decoration.replace, the generated html content contains a strange element
(<img class="cm-widgetBuffer" aria-hidden="true">).
How to make this element not appear?
Please tell me any solution for my problem?
Thanks

Related

Templavoila - Extra space in content when "Typoscript Only" or "Object Path"

This has been bothering me a little for a while and I couldn't find any other mention of that problem anywhere. It is not really important, but maybe there's a simple solution that I'm missing.
When creating a FCE, some Elements are Typoscript only or Typoscript Object Path.
When I set those, I get blank extra space in the content (In picture, see between Content and Description). This is an empty <div class="form-section">, just like the other fields but empty.
Is there a way to prevent Templavoilà Plus from displaying a field if no content is required from the redactor, meaning if they are an Typoscript Object Path for exemple?
please create an issue report about this on https://github.com/pluspol-interactive/templavoilaplus/issues and post an example DataStructure for this.
Thanks

cakephp element not displaying

I have a number of form inputs inside an element as they are repeated in other forms, however it does not output the content of the element when i include it in a view. I can place "Die();" within the element and it will show everything up until that point including the inputs within the element. When checking the source code (without the "Die();") it seems to have disregarded everything within the element including formatting such as DIV's.
The only thing i can think is that cakephp does not like you setting a form in a view then including inputs to the form using elements, does any one know if this is the case, or know the actual reason why this is happening?
The answer is i'm an idiot and forgot to echo the element.... yeah.

Disable escape in Zend Form Element Submit

I can't disable escaping in a Zend_Form_Element_Submit, so when the label has special characters it won't display it's value..
This is my actual Zend Form piece of code:
$this->submit = new Zend_Form_Element_Submit('submit');
$this->submit->setLabel('Iniciar Sesión');
$this->submit->setIgnore(true);
$this->addElement($this->submit);
I've tried $this->submit->getDecorator('Label')->setOption('escape', false); but I obtain an "non-object" error (maybe submit isn't using the "Label" Decorator)..
I've also tried as suggested $this->submit->setAttrib('escape', false); but no text will be shown either.. Any idea? Thanks
Should be as simple as doing this:
$element->addDecorator('Label', аrray('escape'=>false));
Or see setEscape(). http://framework.zend.com/manual/1.12/en/zend.form.standardDecorators.html
Regarding failure to retrieve named decorator... Try getDecorators() Do you see 'label' in the results?
There is no Label decorator for submit form element by default (this is why you get the error).
The $this->submit->setLabel('Iniciar Sesión'); value goes to Zend_View_Helper_FormSubmit, which always does escaping and uses the label as a value.
The helper used by the Submit element escapes by default. Unlike with the label decorator, submit labels are included in a HTML attribute so they need to be escaped.
Your label - Iniciar Sesión - is a perfectly valid UTF-8 string, so the escaped version of it will be the same. If your label is not appearing then something else is going wrong. I'd guess that your page is being served using a charset that doesn't match what Zend View is using (UTF-8 by default).
View the page source to see what actually gets output - that might give you some more clues. Alternatively if the page this form is on is public, if you can provide a URL we might be able to spot the issue.
I ran into a similar issue. In my instance, I added both a label and a description to a text field element. This line of code allowed me to turn off the html escaping for the description attached to that field element:
$form->getElement('txtUPC')->getDecorator('description')->setOption('escape', false);
In my testing, the setEscape() was not recognized by the form elements or their decorators.

Print the particular GWT widget

I'm trying to print a GWT widget as follows,
String html = DOM.getElementById("id").getInnerHTML();
Print.it(html);
I'm not getting the entire html content of the widget. So i'm not able to print the expected result.
Can you help me? Or tell me the alternative way of printing a particular GWT widget from the view.
Thanks in advance,
Gnik
Well, it should print the HTML code. Calling DOM statically may generate 2 problems for you:
The ID you are trying to use isn't the right one. There is another element with the same ID and you are retrieving the element for that ID.
The ID you are using doesn't exist, as a framework may be changing this ID.
You can try to retrieve the HTML code with this widget.asWidget().getElement().getInnerHTML();
That should give you the correct HTML representation of the widget.
And make sure you are calling those methods after the elements are loaded (onLoad()) into the document, or you may recieve a JavaScriptException due to the element being null (check here for more info).

Parsing Text Between Two Empty XML Elements in Objective C

I already know how to parse XML Elements that contain content (<this> Content </this> in Objective C but I am currently using a web service that returns the content I need in between two closed elements (<begin-paragraph/> The content I need <end-paragraph/>) I have been looking online for any examples of anyone else doing this, but I could not find anything. If anyone knows how to read between the two empty elements and would care to share, I would appreciate that very much.
I have to say I regard that as an abuse of XML.
But I've checked and sadly it is well formed so NSXMLParser (which I assume is what you are using) should be able to cope with it.
You basically need to check which element you are in by handling the start element and end element events in your NSXMLParserDelegate. Then after receiving the –parser:didEndElement:namespaceURI:qualifiedName: message for begin-paragraph grab all the text you receive in -parser:foundCharacters: until you receive –parser:didStartElement:namespaceURI:qualifiedName:attributes: for end-paragraph
I don't know what the DOM conformance on the iPhone is like, but the general procedure would be:
Navigate to <begin-paragraph /> in your DOM.
Get the next sibling of that node. That is the content you need. (Node::nextSibling property)
If there are other elements in there that you want, keep collecting them by the same method, until you reach <end-paragraph />