Section heading displays text oddly - mediawiki

I have a wiki page with a normal level 2 section heading.
== 59N ==
But, it displays the N as raised. Why is it doing that and can I change so the N is inline with other characters?
Mediawiki 1.35.6, PHP 8.1.2.

Related

Gmail header data

Hopefully I can make this understandable as I am not a programmer.
I have an email that I believe the header information is correct but the content has been altered.
In the content portion of the header in every gmail that I have sent/forwarded there is an original text version of the email content and an HTML version which is limited to 76 characters and each sentence ends with an =.
This occurs whether the sentence was a complete sentence or if the email servers cut the words into 2 sections like this.
"little boy blue ju=
mped over the moon"=
When the line hit 75 characters it inserted the = sign and moved the rest of the word to the next line
This creates a perfectly square box of text.
Now, I have an email where I believe the almost clever individual attempted to spoof the content part of the header data but instead completed each sentence with a =20 then moved to the next line. No words were cropped and the context is not in a perfect square as it is on every other email header I have inspected.
Also, when an email is forwarded each line is prefaced with a > or a >> which is not the case in this particular email.
Additionally in the HTML portion of the emails the paragraph will end with additional coding such as...
In the HTML code used in Gmails headers, what does the =20 designate?
Also, based on the minimal amount of information I have supplied to you am I correct in believing the content may be spoofed?

Automatically add some kind of text to text?

So basically this:
Is there a program or something where you can input text and then it automatically adds html tags at the beginning and end of the inputted text, for example:
I type the text: "Life finds a way"
Then the program makes it like this:
<p align="center">"Life finds a way"</p>
Matthew
Have a look at Markdown language.
It's exactly what's used when you post something on StackOverflow. Everything you write is converted to html behind the scenes (that's also why you can't print a tag without using code notation in a post).
So simple text is converted to a <p> tag, unless you break two lines with an empty line.
To create an header, just use :
Header
------
which renders like this:
Header
Or like this :
# Header
## Header
### Header
which renders :
Header
Header
Header
Creating lists is also very handy :
* first item
* second item
which renders :
first item
second item
or if you like numbered lists :
1. first item
2. second item
first item
second item
Bold is as simple as : **Bold**
Italic is : *Italic*
Finally, links are simple:
The wikipedia article is linked like this :
[The wikipedia article](http://en.wikipedia.org/wiki/Markdown)

Sublime Text 2 - Problems with HTML automatic indentation

Every time I type an opening html tag (like <div>) then press the Enter key, the cursor automatically inserts an indention on the next line. However I don't want it to be indented since I still have to write the closing tag (actually I press the enter twice and write the closing tag in the third line so I can have an empty line in between). Now I have to press the back button to align the cursor with the opening tag.
I am aware of Sublime Text 2's autocomplete like when you type '<' and Ctrl + Space, a list
of available elements would appear. And when you select one item from the list, the editor would
provide you of both the opening and the closing tag. However, I'm not used to that kind of typing.
So is there a way to turn off this annoying feature of Sublime Text 2
You can disable auto-indentation by setting auto_indent to false.
In order to do this for the HTML syntax only, go to Preferences/Settings – More/Syntax Specific – User and insert the following contents:
{
"auto_indent": false
}
This will make the cursor to jump back at column 0 after hitting return.
To make it stay at the column of the opening tag, re-enable auto_indent and tweak the indentation settings in Packages/HTML/Miscellaneous.tmPreferences. If you aren’t into regular expressions, try to get rid of this file completely.
You can also just type the closing </div> tag and sublime text will automatically un-indent it for you.

I need to pull all paragraphs from any website

I need to take any random website and pull all chunks of text from the website.
I am calling this "paragraph disambiguation" (see "sentence disambiguation" in Wikipedia).
I don't care if these chunks themselves contain other HTML like or as I can get rid of these after I extract the paragraphs text.
I also need to distinguish between the paragraphs as in, this is paragraph 1 and this is paragraph 2 and so on.
I am aware that most paragraphs would typically be contained in a tag. But this is not always the case. Text can also be contained in the following:
<div>
<span>
<td>
<li>
Is there any other HTML elements that might contain a block of text?
Is there any other methodology of extracting text blocks from a random webpage, like looking for "white words" and then finding their boundaries?
Thanks in advance
Jeff
Nearly all HTML elements may include texts:
p
dt
dd
td
th
And many more I can't recall at the moment. Take a look at the Complete list of HTML tags and see which is suitable to contain text, and which is not.
Use Python's Beautiful Soup and call .get_text() on the body element. This will give you all the text in the page.
From Documentation on get_text():
>>> markup = '\nI linked to <i>example.com</i>\n'
>>> soup = BeautifulSoup(markup)
>>> soup.get_text()
u'\nI linked to example.com\n'

How do I test for the percentage of bold text on a webpage?

I have an instance where I need to test how page content is styled (not necessarily only with CSS).
For example, a test (cucumber) I would like to write is:
In order to standardize text weight
As a webmaster
I want to be told the percentage of bold text on the page
The problem is, I'm having a hard time figuring out how to actually generate this result. Looking at various HTML testing frameworks (Selenium, Watir, Capybara), it seems like I can only test for the presence of tags or the presence of css classes, and not the calculated visual result.
In Firebug, I can see the calculated CSS result (which works for <strong>, <b>, and font-weight:bold definitions), but I need to be able to put this into a testing framework to run under CI.
In Watir, you can get access to an elements font-weight by directly accessing the win32ole object. For example:
ie.div(:index, 1).document.currentStyle.fontWeight
This will give you a numbers representing the weight as described in http://www.w3schools.com/cssref/pr_font_weight.asp
What I think you would then need to do is iterate through all elements on the page checking what its fontWeight is and how much text is in the element. The way you do that will depend on the page you are testing.
Solution 1 - If all text is in divs that are leaf nodes:
If all your text is in leaf nodes like this:
<body>
<div style='font-weight:bold'>Bold</div>
<div>Plain</div>
</body>
You could easily do:
bold_text = 0
plain_text = 0
ie.divs.each{ |x|
if x.document.currentStyle.fontWeight >= 700
bold_text += x.text.length
else
plain_text += x.text.length
end
}
Solution 2 - If styles interact or using multiple elements:
If not all of the text is in leaf nodes or you use other tags like <b> (see example HTML below), you would need a more complicated check. This is due to .text returning all text in the element, including its children elements.
<body>
<div style='font-weight:normal'>
Start
<div style='font-weight:bold'>Bold1</div>
<div style='font-weight:bold'>Bold2</div>
End
</div>
<b>Bold Text</b>
</body>
In this case, I believe the following works for most cases (but may need refinement):
#Counting letters, but you could easily change to words
bold_count = 0
plain_count = 0
#Check all elements, though you can change this to restrict to a particular containing element if desired.
node_list = ie.document.getElementsByTagName("*")
0.upto(node_list.length-1) do |i|
#Name the node so it is easier to work with.
node = node_list["#{i}"]
#Determine if the text for the current node is bold or not.
#Note that this works in IE. You might need to modify for other browsers.
if node.currentStyle.fontWeight >= 700
bold = true
else
bold = false
end
#Go through the childNodes. If the node is text, count it. Otherwise ignore.
node.childNodes.each do |child|
unless child.nodeValue.nil?
if bold
bold_count += child.nodeValue.length
else
plain_count += child.nodeValue.length
end
end
end
end
#Determine number of characters that are bold and not. These can be used to determine your percentage.
puts bold_count
puts plain_count
It is not a very Watir-like solution, but hopefully solves your problem.