I am using MVC 5 for application and I have a table in which one record contains a string with formatted text like this
<p><span style="font-size: large;">Good Morning.. Its April 15 today! HAve a nice day..</span></p> <h3></h3> <p><span style="font-size: large;"><br /></span></p>
now when displaying the text in view i need to show the text in the format written inside the record like suppose for above i need like
Good Morning.... Its April 15 today! hava a nice day....
[note: font size is large >
Related
I have sent a test email to Outlook and opened in Outlook app of iOS and the default style of the text for dates/times has its own color.
(The white/gray part is there just to hide the text, you can see the green-ish underline text (which is a date a time)
Apps don't allow debugging so it's difficult to say which class it might have been applied to the displayed HTML.
How to prevent this behavior and have the text by the color defined in CSS?
Note: this is HTML generated via MJML. The transpiled HTML for that paragraph looks like the following:
<tr>
<td align="center" style="font-size:0px; word-break:break-word">
<div style="font-family:helvetica; font-size:10px;">
TEXT WITH DATE
</div>
</td>
</tr>
text-decoration: none works to remove the underline style, but the color doesn't change (color: white) - with or without !important
Solution to avoid date/time auto-linking on iPhone:
Adding:
(Zero Width Space character) between the date/time text parts
nbsp; (Non-breaking space) for blank spaces in between
Example:
Date (WITH smart linking/highlighting): November, 1st 10:15
Non-linked date (WITHOUT smart linking/highlighting): November, 1st 10:15
Some devices auto link date and addresses bc it allows users to one-click add to their calendar or map apps.
To resolve you could wrap that copy with with inline styling so when those devices link that copy it has preset styling for it. Smart phones will auto add the href portion.
Example:
<a style="color:#FFFFFF;text-decoration:none;">
November 13, 2021
</a>
I have to find all paragraph that contains a specific partial text.
I find to find it that way
Whole text in paragraph is
"Open Until: Tuesday November 20, 2018, // 4:00 pm MST"
There is always a new date each time, so i have to give partial text like
element = soup.findAll("p",text="Open Until")
You haven't shared the relevant html elements for that portion, so it is hard to provide you with any solution. However, text="Open Until" doesn't work that way. It only looks for the full text not partial. Try like below instead.
for item in soup.find_all("p"):
if not "Open Until" in item.text:continue
print(item.text)
I have a large table in my sqlite database with a thousands of entries in a field that hold blocks of text.
In the many paragraphs contained in those entries, there is an html tag that recurs regularly that is formatted like this:
<span class="emphasis bold">EXAMPLE TEXT</span>
I would like to replace these tags with simple <b></b> tags.
Therefore, the above example would be reformatted to look like this:
<b>EXAMPLE TEXT</b>
When I say there are many paragraphs in these entries, that means that several of these tags can appear in a single entry. And, it is not the only html that appears. There are even other <span> tags with different attributes, which makes this a bit tricky.
So, whatever sqlite command I come up with, it needs to be able to replace each occurrence of only the <span> tags with the classes emphasis and bold.
If the paragraph looked this:
This is a <span class="emphasis bold">PERFECT</span> example of
what <span class="keep-this-tag">I AM TRYING TO</span> accomplish.
After the sqlite command is run, it should look like this:
This is a <b>PERFECT</b> example of
what <span class="keep-this-tag">I AM TRYING TO</span> accomplish.
As you can see, only the first tag was changed and not the second one, even though they are both <span> tags, because I only want to change the <span> tags with the attributes emphasis and bold.
How do you think I can tackle this problem?
I am trying to extract content from a XHTML document-- in this document, within a div, there are a number of 'b' elements, each followed by a link.
For eg--
<div id="main">
<b> Bold text 1</b>
some link 1
<b> Bold text 2</b>
some link 2
<b> ABRACADABRA</b>
abracadbralink
</div>
Now, I want to extract the link 'abracadabralink'-- the problems are that, I dont know how many and elements are there before this specific link-- in different documents there are a different number of such elements- sometimes there are many links immediately after a single element-- all I do know is that the text for the element that occurs just before the link that I want, is always fixed.
So the only fixed information is that I want the link immediately after the element with known text-- how do I get this link using XQuery?
If I get it right, you are interested in the value of the #href attribute? This can be done with standard XPath syntax:
doc('yourdoc.xml')//*[. = ' abracadbralink']/#href/string()
For more information on XPath, I’d advise you to check out some online tutorials, such as http://www.w3schools.com/xpath/default.asp
I guess the following should work for you:
$yournode/b[. = ' ABRACADABRA']/following-sibling::a/#href/string()
I have text that I would like to translate into Russian. The text has custom tags and has multiple <BR> tags. The API behaves oddly with <BR> tags. Are there known issues with <BR> tags? Is there a way around it or what is the best way to use Google JQuery tranlsation to translate the text?
The text is
<INPUTANSWER PARTID='1'>
<SPAN STYLE="FONT: 7pt 'Times New Roman'"> </SPAN>
Place a <STRONG>90 degree</STRONG> explicit angle constraint to the inside
faces of <STRONG>DP-1007:1 </STRONG>and<STRONG>DP-1006:1</STRONG> as shown.</P>
<P STYLE="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in">
2.
<SPAN STYLE="FONT: 7pt 'Times New Roman'"> </SPAN>
Drive this angle constraint between <STRONG>90 and 100 degrees</STRONG>
with an <STRONG>increment</STRONG> <STRONG>of 0.125 degrees.</STRONG>
</INPUTANSWER>
check this. Its the jquery translate project. I've used it before with normal text, never tried markup but quoting their home page
It also reduces the number of requests by concatenating elements and doesn't send unnecessary html markup still providing access to each element as they've got translated.
If this doesn't work you can always hold on to the original document fragment and just walk it, translate content and replace. I am sure this will work as the API behaved perfectly with plain text.
Find traslator, who would read machine transltions, thats a bad tone. besides completely unclear from English to Russian due complete different language structures. Easier to read in English than auto translated text