Cleanup Document in Eclipse not working in specific case - eclipse

I have a problem using Eclipse Cleanup Document option in case my XML looks like this.
<?xml version="1.0" encoding="UTF-8"?>
<div>
<span style='color:#0000C8'>>
</span>
<h3 style='margin-left:0cm;text-indent:0cm'><a name="_Toc419970681">2.7.2<span
style='font:7.0pt "Times New Roman"'> </span>Helpers</a></h3>
</div>
Clean document works only if I remove <div> tags or if I move </span> after >
After successful [Source - Cleanup Document] XML should look like this.
<?xml version="1.0" encoding="UTF-8"?>
<div>
<span style='color:#0000C8'>></span>
<h3 style='margin-left:0cm;text-indent:0cm'>
<a name="_Toc419970681">
2.7.2
<span style='font:7.0pt "Times New Roman"'>
</span>
Helpers
</a>
</h3>
</div>

May be due to > (>) eclipse consider it as closing tag of span. Hence it can not validate other content after > as this is not proper closing tag of span/div. If you remove DIV tag then it will not find any open tag except span to treats as > however it did not removes you tag at the end.

Related

add new attribute on html through xslt

Let's say I have a ditamap file.I have published into html5.after published let's say my html file look like
<body id="SampleTopic">
<h1 class="title topictitle1" id="ariaid-title1">Sample topic</h1>
<div class="body">
<p class="p">some<strong class="ph b">bold</strong><span class="ph special">text</span></p>
<div class="p">
<dl class="dl">
<dt class="dt dlterm">Term</dt>
<dd class="dd">Defination</dd>
</dl>
</div>
</div>
</article>
</body>
here in Html file, I want to add some new attribute on the body element like
<body id="SampleTopic" class="test">
so can anyone help me with how to solve this????
can I add some plugin, if yes how to write the code???
If all you need is the HTML #class attribute, then there's no need to develop a custom plug-in.
You can just specify a value for the #outputclass attribute on an element in your DITA source files, and the value will be passed to the HTML #class attribute in the output.

Github pages are not showing images

Images are not showing on my site on github pages.
This is my site:https://rsgrw23.github.io/rate-your-beer/
Locally everything is working fine.
This is the repository: https://github.com/rsgrw23/rate-your-beer
What is wrong?
For example, here's an excerpt of src/components/home.vue <template>:
<template>
<div class="home">
<img class="home__img__header" src="src/assets/craft-beer.jpg" alt="Craft Beer">
<header class="home__header">
<transition appear appear-active-class="bounce-enter-active">
<h1>"Czasem najlepszym wyjściem</h1>
</transition>
<transition appear appear-active-class="bounce-enter-active">
<h2>Jest wyjście na piwo"</h2>
</transition>
</header>
<main class="home__main">
<h1 class="home__title">Fun Facts</h1>
<article class="home__article">
<div class="home__content content-1"><h1>Lepsze od wody?</h1>
<p>W mi... dziś.</p></div>
<img class="home__img img-1" src="src/assets/wish-you-beer-here.jpg" alt="piwo">
</article>
<article class="home__article">
<img class="home__img img-2" src="src/assets/beer-mine.jpg" alt="piwo">
<div class="home__content content-2"><h1>Nie tylko z chmielem</h1>
<p>Je...em.</p>
<p>Co cie...ika!</p></div>
</article>
<article class="home__article">
<div class="home__content content-3"><h1>IPA czyli napój żołnieży</h1>
<p>Bry...wa.</p></div>
<img class="home__img img-3" src="src/assets/water.jpg" alt="piwo">
</article>
</main>
<div class="description">
<div class="description__content">
<div class="description__article">
<h1 class="description__header">Piłeś piwko?</h1>
<h2 class="description__header">Oceń je!</h2>
</div>
</div>
</div>
</div>
</template>
Images are located at src/assets/craft-beer.jpg for instance.
So webpack is able to find the images and process them as resources, you should reference the assets (images) via relative paths, not absolute paths.
So, considering a file at /src/components/home.vue with images at /src/assets (being / the project root), instead of:
<img class="home__img__header" src="src/assets/craft-beer.jpg" alt="Craft Beer">
Use:
<img class="home__img__header" src="../assets/craft-beer.jpg" alt="Craft Beer">
Naturally, in other files, change the relative path accordingly.
For the images to work with Vue the generated file there are few ways.Here is an SO link on the same.
How to import and use image in a Vue single file component?
What you will want to do here is something like this.
<img class="home__img__header" src="~src/assets/craft-beer.jpg" alt="Craft Beer">
This lets the webpack know about the image being an asset and generate its path appropriately.

Indexed Search extbase htmltags in output

I am using TYPO3 7.6.11 and indexed_search 7.6.0.
I use the extbase plugin for indexed_search and in the output it escapes the HTML-Tags to mark the searchword. For example, when I search for "search" I get this output:
Test text with<strong class="tx-indexedsearch-redMarkup">search</strong> pattern.
I found this bugfix to this problem: https://forge.typo3.org/issues/77901
But the file PageBrowsingResultsViewHelper.php doesn't look exactly the same, and even when I add the variable protected $escapeOutput = false; it doesn't change anything.
Any idea where this is come from and where I can disable the escaping?
It was another extension who overwrote a Partial of tx_indexedsearch that caused the problem.. -> Always check if the template you are working on is the one that gets outputted ;)
This happen because of format object rendering.your result will render in {row.description} object and initially there is no format set. you have to format your result({row.description}) to the HTML. For that:
Go to the search result file.
yourindexsearch/templatingpath/IndexedSearch/Partials/Searchresult.html
Here is the complete file:
<div class="fourffCom col-sm-6">
<f:format.html><h2>{row.title}</h2></f:format.html>
<f:if condition="{row.headerOnly} == 0">
<!-- Format html -->
<f:format.html>{row.description}</f:format.html>
<ul>
<li>
<p><f:translate key="result.size" /> </p>
<b>{row.size}</b>
</li>
<li>
<p class="tx-indexedsearch-text-item-crdate"><f:translate key="result.created" /> </p>
<b class="tx-indexedsearch-text-item-crdate"><f:format.date>#{row.created}</f:format.date></b>
</li>
<li>
<p class="tx-indexedsearch-text-item-mtime"><f:translate key="result.modified" /> </p>
<b class="tx-indexedsearch-text-item-mtime"><f:format.date>#{row.modified}</f:format.date></b>
</li>
<li>
</li>
<li>
<p><f:translate key="result.path" /> </p>
<b><f:format.html>{row.path}</f:format.html></b>
</li>
</ul>
</f:if>
<f:if condition="{row.headerOnly} == 1">
<!-- Format html -->
<f:format.html>{row.description}</f:format.html>
</f:if>
<f:if condition="{row.subresults}">
<p class="tx-indexedsearch-list">
<f:for each="{row.subresults.items}" as="subrow">
<f:render partial="Searchresult" arguments="{row: subrow}" />
</f:for>
</p>
</f:if>
</div>

FluidTYPO3: How do I render content from other extensions (news...)?

Actually I found the answer already on this site
Preferred way to add an extensions into Fluid Powered TYPO3 template
but I don't get it to work :-(
I have a page template with main content and in the sidebar content from FlexSlider extension and at the bottom I want to render the list view of extension news. So I guess answer 1a from Claus will fit:
1a) create the element in a sys folder and reference it from your Flux form settings then use v:content.render to render it by UID.
but how is that done? How do I reference it from my Flux form?
Has somebody an example code. I couldn't find a tutorial or a documentation...
Thanks for reading and hopefully you have an answer ;-)
Jürgen
An easy way is to create a typoscript element and then render it in fluid:
lib.rightcolumn = CONTENT
lib.rightcolumn {
table = tt_content
select {
pidInList = 42
where = colPos=1
}
}
<f:cObject typoscriptObjectPath="lib.rightcolumn" />
Another way is to directly create it in fluid:
https://fluidtypo3.org/viewhelpers/vhs/master/Content/RenderViewHelper.html
Finally I got it accidentally by fixing another problem:
Fluid Powered TYPO3 FLUX Fluidcontent - No Output in Frontend?
I had to add the file "typo3conf/AdditionalConfiguration.php" with
<?php $GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'] = array('fluidcontentcore/Configuration/TypoScript/');
Thanks for help nBar, I used "f.cObject" as workaround.
Now here is my Page/Template code:
<f:section name="Configuration">
<flux:form id="homepage">
<flux:grid>
<flux:grid.row>
<flux:grid.column colPos="0" colspan="2" name="main" label="Main content"/>
<flux:grid.column colPos="1" colspan="1" name="logoslider" label="Logo slider"/>
</flux:grid.row>
<flux:grid.row>
<flux:grid.column colPos="2" colspan="3" name="news" label="News"/>
</flux:grid.row>
</flux:grid>
</flux:form>
</f:section>
<f:section name="Main">
<div class="container">
<div class="row">
<div class="col-md-8">
<v:content.render column="0"/>
</div>
<div class="col-md-4 team_logos">
<div class="infobox">
<v:content.render column="1"/>
</div>
</div>
</div>
<div class="row infobox">
<div class="col-md-12">
<v:content.render column="2"/>
</div>
</div>
</div>
</f:section>

How to extract div tag

I'm trying to parse a html file and I want to extract everything inside a outer div tag with a unique id. Sample:
<body>
...
<div id="1">
<div id="2">
...
</div>
<div id="3">
...
</div>
</div>
...
</body>
Here I want to extract every thing in between <div id="1"> and its corresponding </tag> NOT the first </div> tag.
I've gone through many older posts but they don't work because they stop when they see the first </div> tag which is not what I'm looking for.
Any pointer would be appreciated.
It sounds like your problem is that you are trying to parse HTML using regular expressions.
Don't. Use an HTML parser. There are plenty on CPAN. I'm fond of HTML::TreeBuilder::XPath.
Quentin has rightly mentioned using an HTML parser to extract div content. Here's one option using Mojo::DOM:
use strict;
use warnings;
use Mojo::DOM;
my $text = <<END;
<body>
...
<div id="1">
Under div id 1
<div id="2">
Under div id 2
</div>
<div id="3">
Under div id 3
</div>
</div>
Outside the divs
</body>
END
my $dom = Mojo::DOM->new($text);
print $dom->find('div[id=1]')->pluck('text');
Output:
Under div id 1