The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> [revised] How to insert a semicolon before every 1st <br>eakline in every <p>aragraphs?, Thank thank everyone
S.mutans
post Sep 30 2016, 11:01 PM
Post #1





Group: Members
Posts: 7
Joined: 27-September 16
Member No.: 24,862




How to insert a semicolon before every 1st breakline in every paragraphs?

Thank thank everyone


This is a dictionary text file.
Every paragraphs are enclosed by
<p class="calibre_11">paragraph1</p>.

I want to add a semicolon
before every 1st breakline
in every paragraphs?

I want to ask about
1. the necessary tools and
2. the method
to make this change:

Find and replace all

CODE
<p class="calibre_11">
<span class="bold">
entry1
</span>
different contents
<br class="calibre1"/> // want to insert a semicolon before the 1st breakline
meaning1
<br class="calibre1"/> // other breaklines remain unchanged
meaning2
<br class="calibre1"/> // other breaklines remain unchanged
meaning3
</p>


to

CODE
<p class="calibre_11">
<span class="bold">
entry1
</span>
different contents
;<br class="calibre1"/> // inserted a semicolon before the 1st breakline  
meaning1
<br class="calibre1"/> // other breaklines remain unchanged
meaning2
<br class="calibre1"/> // other breaklines remain unchanged
meaning3
</p>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
S.mutans
post Oct 5 2016, 10:18 AM
Post #2





Group: Members
Posts: 7
Joined: 27-September 16
Member No.: 24,862



Sorry, I was nearly unaware of your file.
Were it not for your help, I had to visit psychiatrist.
Thank you Thank you Thank thank you.

This post has been edited by S.mutans: Oct 5 2016, 10:48 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 5 2016, 03:45 PM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



I take it I got it right then. biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
S.mutans
post Oct 5 2016, 10:21 PM
Post #4





Group: Members
Posts: 7
Joined: 27-September 16
Member No.: 24,862



Somebody gave me this java script:

CODE
[].forEach.call(document.querySelectorAll('.calibre_11 br:first-of-type'), function (e) {
  e.insertAdjacentText('beforebegin', ';')
})


I want to change the dictionary.ePub into AnkiDecks .apkg file.
Anki only accept importing .txt file in UTF-8.
Your file not in in UTF-8 doesn’t get right.

It is nothing bad for you to own "Collins Concise German-English Dictionary.apkg".
I can send you a copy after it is done.

This is an example of a valid file:
CODE
entry1; meanings; optional; optional; ...
entry2; meanings; optional; optional; ...
entry3; meanings; optional; optional; ...


This post has been edited by S.mutans: Oct 5 2016, 10:50 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 6 2016, 02:21 PM
Post #5


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(S.mutans @ Oct 6 2016, 05:21 AM) *

Somebody gave me this java script:

CODE
[].forEach.call(document.querySelectorAll('.calibre_11 br:first-of-type'), function (e) {
  e.insertAdjacentText('beforebegin', ';')
})


Note that any changes made by javascript are just temporary. Also insertAdjacentText is a new feature, with limited browser support.

QUOTE
I want to change the dictionary.ePub into AnkiDecks .apkg file.

Seems https://en.wikipedia.org/wiki/Anki_(software) does use HTML, but I don't know if it supports javascript too?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic
S.mutans   [revised] How to insert a semicolon before every 1st <br>eakline in every <p>aragraphs?   Sep 30 2016, 11:01 PM
Christian J   I haven't looked at the linked 60MB file, but ...   Oct 1 2016, 06:27 PM
pandy   Is this what you want? http://filenurse.com/downlo...   Oct 1 2016, 08:59 PM
Christian J   I can give you the few lines of code it takes I ...   Oct 2 2016, 07:44 AM
pandy   Sure. Things like this can be done in a very simpl...   Oct 2 2016, 08:58 AM
pandy   I just discovered that the forum tries to correct ...   Oct 2 2016, 09:02 AM
pandy   OK, so just inside CODE. :ninja: I see now that...   Oct 2 2016, 09:13 AM
Christian J   OK, so just inside CODE. :ninja: This seems li...   Oct 2 2016, 09:39 AM
pandy   But regex isn't needed. Just searching for the...   Oct 2 2016, 10:20 AM
Christian J   Which text editor is that? I don't think Tex...   Oct 2 2016, 09:32 AM
S.mutans   Never-mind I have another .ePub file dictionary ....   Oct 2 2016, 07:49 PM
pandy   So what has changed more than the file format?   Oct 2 2016, 08:02 PM
pandy   Also, what's wrong with the file I uploaded? D...   Oct 4 2016, 05:43 AM
S.mutans   Sorry, I was nearly unaware of your file. Were it ...   Oct 5 2016, 10:18 AM
pandy   I take it I got it right then. :D   Oct 5 2016, 03:45 PM
S.mutans   Somebody gave me this java script: [].fo...   Oct 5 2016, 10:21 PM
S.mutans   There left some <p>aragraphs without any sem...   Oct 5 2016, 11:33 PM
pandy   Are any characters currupted in my file? If not, j...   Oct 6 2016, 07:23 AM
Christian J   [url=http://codepen.io/arthow4n/pen/JRJkGw]Somebo...   Oct 6 2016, 02:21 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 12:13 AM