when i copy and Paste text it in text-angular getting issue - angularjs

Text contains info includes bold,italic and etc.,
when i copy text(it includes double quotes like:"hey hi") and paste it in text-angular,while displaying text is fine.in console i can double-quotes in place of &#34.This &#34 created as hashtag.
when i enter manually in text-angular text &#34.Hash tag is not creating
And my app has one more feature called as hashtag.
Example log info:
<p>"test from web"</p>
original text:
"test from web"
The library which am using is https://github.com/textAngular/textAngular

Related

Formatting Text Area will not format when using Advanced Custom Fields? Delivered using GraphQL

I am trying to format the content of 'Text Area' when using WordPress's Advanced Custom Fields. I am using React to build the project.
In an attempt to debug, I have been following this documentation and set my options to resemble the image referenced. Including Text Area as one of my custom fields and setting the New Lines option to Automatically add paragraphs
The documentation then goes on to show an example using PHP to render the content.
I am using graphQL to fetch my data, and delivering the contents as follows:
<div className="media-description-area">
{this.props.activeDescription}
</div>
with activeDescription being destructured from the object that the GraphQL request delivers.
The text as its being set in the field itself looks like this, with spacing included:
The formatting tags are being rendered directly into the string itself, this how it is appearing in the document:
Does anyone know how why this is? I am referring to the field directly so it appears as this formatting is being delivered from WordPress itself
activeDescription: objects[0].items[0].projectDescription,
Thank You

How to format HTML in .csv for import into Enhance Dynamic Content - SFMC

with Enhanced Dynamic Content - you have to upload a .csv file and each column will turn into an EDC Map Content Block. I then create the email and drag in the Enhanced Dynamic Content Block. Each cell has to contain the proper HTML formatting as you cannot do that once it's been uploaded. I can get everything to work except muli-line text - or text with line breaks in it. I'm not sure if I'm formatting the HTML incorrectly - or if EDC does not support line breaks. In which case I would have to create a copy column for each paragraph - and that does not sound right.
Too much. I've tried adding between sentences. I've tried inserting line breaks in an Excel version of the document - then saving as .csv - this is supposed to insert some double quotes somewhere but does not.
"""""At The Hanover, we’re excited to make our latest move into the state of %%BillingState%%.
As a New England-based company with national reach, we value local, independent agents and all you do to help ensure your customers have the right protections in place.
We look forward to launching our personal lines products and services in %%BillingState%% in partnership with select independent agents."""""
The custom text for the cell above does not display - rather it displays one line text from the default row.
I ran into the same issue.
What I found worked in my instance was to add <p> Your text </P>, so that when you import it, it should respect the line breaks.

Capybara integration testing 'TextAngular' input

Using TextAngular for a rich text input box in a AngularJS/ Rails environment.
Running integration tests with Capybara/Selenium & Capybara-Webkit.
Tried to create an integration test that inputs text into the text area for a test. However, I have not been able to successfully do this.
The thing that has prevented me is the text input box id changes ever time the test loads or page loads. So I used the below class, which is used in the text angular tests. With:
find('textarea.ta-html.ta-editor')
I used this as i know it works and the javascript tests written for text angular used this. text angular github tests
However, when i try and set the text area with a text value:
find('textarea.ta-html.ta-editor').set("Upgraded to SSD")
I get:
Failure/Error: find('textarea.ta-html.ta-editor').set("Upgraded to SSD")
Selenium::WebDriver::Error::ElementNotVisibleError:
Element is not currently visible and so may not be interacted with
How can I set a value for the text area using Capybara?
The element that matches textarea.ta-html.ta-editor is hidden on the page and is not the element a user interacts with. By design Capybara generally requires you to interact with the elements a user would interact with so you need to call #set on the visible element which is the previous sibling to the element you're attempting to interact with and matches div[contenteditable]. You don't show your HTML but hopefully you have a containing element you can scope to so you can do
find('<container_selector> div[contenteditable]').set(...)
or
find('<more_general_container_selector>', text: '<label text or something else in the container>').find('div[contenteditable]').set(....)
If you only have one of this type of field on the page you can probably get away with
find('.text-angular div[contenteditable]').set('Upgraded to SSD')
Note: If using the selenium driver it has a limitation that it can only interact with the main contenteditable element and not with the children that get created inside it. I'm not sure if the other capybara drivers have the same issue.

How to highlight a query term in a field containing html in Solr

I have a body field that may contain html text from a rich text editor. I want to be able to return highlighted snippets from it, but with the html stripped out.
Take the text below that gets indexed:
<p class="something">some text here with words and other text</p>
If you search for 'words', you might get the following highlight snippet (depending on fragment length etc):
class="something">some text here with <em>words</em> and other text</p>
or
class="something">some text here with <em>words</em> and other text
Where the HTML is split, which will cause rendering problems on the front-end. I want to strip out the html before the highlighting is applied. I've tried different highlighting components but haven't seen any properties that do the trick.
Do I need to strip the HTML before indexing? Or is there another technique for this?
At the moment I'm using HTMLStripCharFilterFactory to strip out HTML at index time, but the highlighting component using the underlying stored data which is the original html.
I also have the same problem and have concluded that the only way is to use two fields, for example:
content_html: original html, uses HtmlStripCharFilterFactory so just the html content will be indexed/tokenized
content_stripped: text content only, will be used for highlighted fragments
In C# I'd use HtmlAgilityPack, for example, to load the HTML into a document then call .Text on the root node.
Both fields should be stored so that you can use the text-only field for fragments and the html field for when you want the entire field to be highlighted.
I looked into both Solr and ElasticSearch and from what I found there's no built-in way because highlighting is performed on whatever is stored.
Related: Solr Strip html when highlighting with stored html fields
Related: How to handle html tags in highlight fragment in SOLR

How to substitute an end of line character from Salesforce Text Area field

I am using a text area field in Salesforce as a RecipientNote for a Docusign envelope created using a custom button in Salesforce.
The syntax below handles any commas or special characters, but I'm unable to find the correct syntax to preserve any linebreaks in the Program_Exception_Notes__c field.
;RecipientNote~{!JSENCODE(URLENCODE(SUBSTITUTE(Sales_Program_Info__c.Program_Exception_Notes__c,",","_COMMA_")))}
I have tried the following but none worked. Any ideas?
'{!SUBSTITUTE(JSENCODE(URLENCODE(SUBSTITUTE(Sales_Program_Info__c.Program_Exception_Notes__c,",","_COMMA_"))),"%0D%0A","\\n")}'
'{!JSENCODE(URLENCODE(SUBSTITUTE(SUBSTITUTE(Sales_Program_Info__c.Program_Exception_Notes__c,"\r\n","\\n"),",","_COMMA_")))}'
I would process your text in a couple of steps in jscript.
first break the text into an array of string lines
escape characters you are looking to correct
then reassemble using the "\n" when you put it back together into a var
Then after all that, URL and JS encode that string variable.

Resources