Here is the code block:
<p>
Confira abaixo as perguntas frequentes. Se ainda assim
precisar, você poderá fazer #Html.ActionLink("contato nas unidades mais próximas",
"Index", "UnidadesEstados", new { target = "_blank" })
ou por e-mail.
</p>
If I remove the new { target = "_blank" } the page open correctly in the same tab.
I want to open this in a new tab, but when I execute, the URL that open its like:
http://localhost:61467/FAQ?**Length=15**
What I´m doing wrong?
I had included a null parameter between the others and this did the trick:
#Html.ActionLink("contato nas unidades mais próximas", "Index", "UnidadesEstados", null, new { target = "_blank" })
Related
For a django project i need to generate from the Django Website a kind of complex Word document.
I started using Docx-Template that do the job great but i encountered a problem:
For certain "spot" in the word template i need to brake Django rich texte (HTML) in something usable for Docx Template
So i went into transforming my richtext in a list that can have two types of elements (to keep the order of the blocs) : ["some paragraphs","('list',['first elt of the list for bullet','second','ect...")]
For now i have two function : one that break the HTML and one that transform it
My "HTML Breaking function" is like that :
def decoupe_html (raw_html):
soup=BeautifulSoup(raw_html,"html.parser")
arbre=[]
#decoupe en grand bloc HTML
for elt in soup:
arbre.append(elt)
print(arbre)
#On parcours chaque elt pour le transformer en truc compréhensible par Word dans une liste
for elt in arbre:
#recup du tag de début du "chunk"
tag=elt.name
#traitement des paragraphe de texte
if tag == "p":
texte=elt.text
place=arbre.index(elt)
arbre[place]=texte
#traitement des listes
elif tag == "ul":
list_elt=[]
enfants = elt.findChildren()
#on récupère tous les elt de la liste
for chld in enfants:
list_elt.append(chld.text)
place=arbre.index(elt)
arbre[place]=("list",list_elt)
return(arbre)
But i have trouble in "breaking" more complex list with multi level like for example this html :
<p>pfoizepfkjze</p>
<ul>
<li>blabla
<ul>
<li>bla2
<ul>
<li>bla3
<ul>
<li>bla4</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>rebla</li>
</ul>
what should i change in my code to keep my data structure and get for example :
arbre = ['pfoizepfkjze',('list',['blabla',('list',['bla2',('list',['bla3',('list',['bla4'])])]),'rebla'])]
Thanks all for your help :)
This question already has answers here:
How to wrap text inside to different paragraphs around image inside the first paragraph (<p> tag). (Content is inputted using CKeditor Plugin)
(5 answers)
Closed 4 years ago.
I am using CKeditor to input RichText.
Inside the text area of CKEditor, the text is perfectly wrapped over the image.
But the text is not wraping on the html page.
This is how it looks in CKeditor
But my html looks like this.
What may be I am missing here. ?
Here is the actual code snippet
<p>Enter each item on a new line, choose the amount of groups unders settings, and click the button to generate your randomized list. Don't like the first team? Just click again until you do.Fairly pick teams without bias. No need to draw names out of a hat. No need to do a grade school style draft or put hours of thought into the most balanced teams. The most fair dividing method possible is random.Enter each item on a new line, choose the amount of groups unders settings, and click the button to generate your randomized list. Don't like the first team? Just click again until you do.Fairly pick teams without bias. No need to draw names out of a hat. No need to do a grade school style draft or put hours of thought into the most balanced teams. The most fair dividing method possible is random.Enter each item on a new line, choose the amount of groups under
<img alt="" src="/media/uploads/2018/09/27/sufs5o_fWCbPPM.jpg" style="float:right; height:1080px; width:420px">
Enter each item on a new line, choose the amount of groups unders settings, and click the button to generate your randomized list. Don't like the first team? Just click again until you do.Fairly pick teams without bias. No need to draw names out of a hat. No need to do a grade school style draft or put hours of thought into the most balanced teams. The most fair dividing method possible is random.Enter each item on a new line, choose the amount of groups unders settings, and click the button to generate your randomized list. Don't like the first team? Just click again until you do.Fairly pick teams without bias. No need to draw names out of a hat. No need to do a grade school style draft or put hours of thought into the most balanced teams. The most fair dividing method possible is random.Enter each item on a new line, choose the amount of groups unders settings, and click the button to generate your randomized list. .
</p>
<p>s settings, and click the button to generate your randomized list. Don't like the first team? Just click again until you do.Fairly pick teams without bias. No need to draw names out of a hat. No need to do a grade school style draft or put hours of thought into the most balanced teams. The most fair dividing method possible is random.Enter each item on a new line, choose the amount of groups unders settings, and click the button to generate your randomized list. Don't like the first team? Just click again until you do.Fairly pick teams without bias. No need to draw names out of a hat. No need to do a grade school style draft or put hours of thought into the most balanced teams. The most fair dividing method possible is random.Enter each item on a new line, choose the amount of groups unders settings, and click the button to generate your randomized list. Don't like the first team? Just click again until you do.Fairly pick teams without bias. No need to draw names out of a hat. No need to do a grade school style draft or put hours of thought into the most balanced teams. The most fair dividing method possible is random.</p>
<img align="right" hspace="3px" vspace="3px" alt="" src="/media/uploads/2018/09/27/sufs5o_fWCbPPM.jpg" style="height:1080px; width:420px">
Try this on
.floatright {
float: right;
clear: right;
position: relative;
margin: 0 0 0.5em 0.5em;
}
<div style="text-align:justify;margin:6px">
<img src="//upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Mandala1_detail.jpg/150px-Mandala1_detail.jpg" width="150" height="173"
class="floatright"
>
<p>
El arte budista tiene su origen en el subcontinente indio (actuales India, Bangladés, Nepal y Pakistán) en los siglos posteriores a la vida de Siddhartha Gautama, el Buda histórico, entre los siglos vi y v a. C. Más tarde, gracias al contacto con otras culturas, logró evolucionar y difundirse por el resto de Asia y el mundo.
Una primera etapa, llamada preicónica, se sitúa antes del siglo i d. C. y se caracteriza por no recurrir a representaciones directas de Siddhartha Gautama como el Buda Śākyamuni o de los budas míticos que se suponen existieron en eras pasadas. La etapa siguiente, icónica, tiene por el contrario a la imagen humana del Buda y los budas del pasado, del futuro y de otros universos como símbolo central de sus obras de arte.
Desde entonces, el arte budista se diversificó y evolucionó para adaptarse a las nuevas regiones en las que comenzaba a sumar adeptos. Se expandió hacia el este y el norte a través de Asia Central, para formar lo que luego fue clasificado como arte budista del norte —en contraposición al arte budista del sur, que surgiría en el sudeste de Asia. En India, el arte budista floreció e incluso llegó a influir en el desarrollo del arte hindú, hasta que el budismo casi desapareció alrededor del siglo x, con la expansión del hinduismo y el islam.
</p>
<p>
El arte budista tiene su origen en el subcontinente indio (actuales India, Bangladés, Nepal y Pakistán) en los siglos posteriores a la vida de Siddhartha Gautama, el Buda histórico, entre los siglos vi y v a. C. Más tarde, gracias al contacto con otras culturas, logró evolucionar y difundirse por el resto de Asia y el mundo.
Una primera etapa, llamada preicónica, se sitúa antes del siglo i d. C. y se caracteriza por no recurrir a representaciones directas de Siddhartha Gautama como el Buda Śākyamuni o de los budas míticos que se suponen existieron en eras pasadas. La etapa siguiente, icónica, tiene por el contrario a la imagen humana del Buda y los budas del pasado, del futuro y de otros universos como símbolo central de sus obras de arte.
Desde entonces, el arte budista se diversificó y evolucionó para adaptarse a las nuevas regiones en las que comenzaba a sumar adeptos. Se expandió hacia el este y el norte a través de Asia Central, para formar lo que luego fue clasificado como arte budista del norte —en contraposición al arte budista del sur, que surgiría en el sudeste de Asia. En India, el arte budista floreció e incluso llegó a influir en el desarrollo del arte hindú, hasta que el budismo casi desapareció alrededor del siglo x, con la expansión del hinduismo y el islam.
</p>
</div>
I have a request in my web api that give me a Json like this
{
"$id": "1",
"ID": 9710,
"post_author": 2,
"post_date": "31/08/2017",
"post_content": "Assim como aconteceu no primeiro Destiny, a <strong>Bungie</strong> e a <strong>Activision</strong> lançaram nesta quinta-feira (31) um trailer live action de <strong>Destiny 2</strong>, com direito a <strong>Cayde-6</strong> fazendo um discurso motivacional, lembrando que todas as coisas que você ama na Terra se foram (inclusive os cachorrinhos).<br><br><div class=\"video\"><iframe src='https://www.youtube.com/embed/UhE6B3MPsUM'></iframe></div><br><br>O trailer por <strong>Jordan Vogt-Roberts</strong> mais conhecido pelo seu trabalho em <strong>Kong: A ilha da Caveira</strong>.<br><br>A nossa aventura em Destiny 2 começa com os <strong>Guardiões</strong> buscando vingança após ter a última cidade segura na Terra destruída pela Legião Vermelha, liderada pelo poderoso <strong>Ghaul</strong>. Com isso, será necessário que exploremos novos mundos do sistema solar, em busca de armas e habilidades para vencer essa guerra e recuperar a nossa luz.<br><br><strong>Destiny 2</strong> será lançado em 6 de setembro pra <strong>Xbox One </strong>e <strong>PS4</strong>. No PC o jogo será lançado um mês depois no dia 24 de outubro.<br><br><strong>Saiba mais sobre Destiny 2</strong>",
"post_title": "Destiny 2 ganha trailer live action ao som Sabotage",
"post_name": "destiny-2-ganha-trailer-live-action-ao-som-sabotage",
"guid": "http://nextseason.com.br/?p=9710",
"meta_value": 9711,
"id_post_img": 9711,
"link_imagem": "http://nextseason.com.br/wp-content/uploads/live-action-destiny-2.jpg",
"id_post_categoria": 9710,
"category": "Games"
}
and in app using Ionic 2 i put the code
<div [innerHtml]="post.post_content"> </div>
where post.post_content is the post_content from my request.
inside the post_content has an with a embed youtube video, but when i run the, the video does not show. In debug appears like that.
<div>Assim como aconteceu no primeiro Destiny, a
<strong>Bungie</strong> e a <strong>Activision</strong>
lançaram nesta quinta-feira (31) um trailer live action de <strong>Destiny
2</strong>, com direito a <strong>Cayde-6</strong> fazendo um discurso
motivacional, lembrando que todas as coisas que você ama na Terra se foram
(inclusive os cachorrinhos).<br><br><div class="video"></div><br><br>O
trailer por <strong>Jordan Vogt-Roberts</strong>
the div element always shows empty. Someone can help me? have any idea why this occurs?
Sorry my english!
To be honest, this is my first time using asp.net web api and Razor.
I received an asp.net web api solution which uses itextSharp to generate a pdf.
The pdf is generated, but it is showing html tags that were sent with the content via jquery and JSON.
This is how it looks in PDF:
<div class="nf-filler-control-border"><div class="nf-filler-control-inner"><div class="ms-r
testate-field"><div
class="ExternalClassD88FE0C0B2A64B1797917A506C26ACA2"><div
class="ExternalClassAD6BB90065794E90B1097577B8697812">Aantal genodigden: 19</div><div
class="ExternalClassAD6BB90065794E90B1097577B8697812">Aantal aanwezig: 15</div><p
class="ExternalClassAD6BB90065794E90B1097577B8697812">Aantal ziek/verlof: 3</p><div
class="ExternalClassAD6BB90065794E90B1097577B8697812"><ol><li>Bij veiligheidsrondgang uitgevoerd op 02/04/13. Veel
gereedschap ligt niet op hun plaats, is onbeheerd achtergelaten, ligt in fietskarren, en zijn bovendien niet ingeschreven in
het register; kasten staan open, ladders niet afgesloten.</li><li>Persoonlijk werkgereedschap blijft gewoon liggen zelf
heeft men de dag erna verlof. = rommel.</li><li>Bij controle stekkers verleng kabels zien we dat de trekontlasting niet
correct gebruikt wordt en dat de insnijdingen te groot zijn. Zie foto's.</li>
<li>Alle communicatie (ziektebriefjes, KV,.....)met HR is nu naar Interleuvenlaan 27A - 3001 Herverlee
(achterzijde personeelsbadge)</li></ol></div></div></div></div></div>
this is the piece of code that displays data which is sent via jquery's ajax function: #Model.Description
And this is where the Razor engine parses the html template: return Razor.Parse(template, model);
Anyone has got any idea how to show the content properly inside the pdf without showing up the html tags on the document?
the html table shows fine, only the data displayed by #Model.Description does not show correctly.
this is the code:
private static string GetReport(ToolBoxMeeting tm)
{
var config = new TemplateServiceConfiguration
{
BaseTemplateType = typeof (HtmlTemplateBase<>)
};
using (new TemplateService(config))
{
string template = #"<html>
<body >
<table >
<tr>
<td'>Description</td>
<td>
#Model.Description
</td>
</tr>
</table>
</body>
</html>";
var model = tm;
return Razor.Parse(template, model);
}
}
I'm having some problems having html tags correctly loaded in my Rails 3.2 app, and have no clue why. I managed to get it working for one flash message, but I am not managing to do it with a confirmation message.
Any ideas ?
My pt.yml file extract :
buttons:
accept_terms: "Aceito os termos e condições"
save: "Gravar"
delete: "Apagar"
add_new_receipt: "+"
add_receipt_label: "Clique para adicionar novo recibo"
download_all_html: "Tem a certeza que deseja descarregar todos os ficheiros correspondentes à pesquisa? <br />
Esta operação pode demorar algum tempo, dependendo do número de ficheiros e da sua ligação à Internet "
my view code:
<%= link_to (t :download_all, scope: "pages.home.customers"), user_download_all_path(user_id:current_user.id, is_retailer: params[:controller]=='suppliers' ? true : false), method: :post, class: "btn btn-primary", confirm: t(:download_all_html, scope: "buttons") %>
In the end, My confirmation message shows the <br /> as is....
I believe I am following rails guidelines here, so any help would be appreciated to figure this one out.
Edit
I had already tried html_safe.
I have one other example that is working :
tags:
error_message_html: "O número %{message} ou não existe ou já foi mapeado.<br />
Por favor verifique que o número corresponde à empresa seleccionada "
and I invoke it inside a controller :
flash[:error] = t :error_message_html, scope: "forms.tags", message: params[:tag][:number]
Rails will escape the html contained in the translation
You can allow the html to be used with html_safe
<%= link_to (t :download_all, scope: "pages.home.customers").html_safe, user_download_all_path(user_id:current_user.id, is_retailer: params[:controller]=='suppliers' ? true : false), method: :post, class: "btn btn-primary", confirm: t(:download_all_html, scope: "buttons") %>