Closed Bug 720228 Opened 12 years ago Closed 5 years ago

including a template adds unnecessary space to template

Categories

(support.mozilla.org :: Knowledge Base Software, task, P3)

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: atopal, Unassigned)

References

Details

When you include a template in an article that template is automatically appended with a space character for no apparent reason. From the source code it looks like we append templates with a line break. In any case, a following punctuation mark is preceded by a space character, which is wrong in many languages. 

Please remove that space.
Moving all 2012Q1 bugs to Future.
Target Milestone: 2012Q1 → Future
At the time of reporting bug 852275 and possibly this bug, this was a space issue allright, though Kadir referred to a line break insertion above (though this may be a line break versus carriage return issue). Anyway, the problem was a visible space until recently, but recent code changes to Sumo now appear to have changed this into a clear line break issue allright, as end stops now appear on a next line, making it a little bit worse than before.

Example: https://support.mozilla.org/en-US/kb/unable-install-add-ons-or-extensions - see the optionsPreferences line right after "To add the site to the trusted sites list:".
Gah! I saw this the other day and wondered what was going on. Thanks for looking into it.
Priority: -- → P3
Whiteboard: u=contributor c=wiki s= p= → u=contributor c=wiki p= s=2014.3
(In reply to Ton from comment #3)
> Example:
> https://support.mozilla.org/en-US/kb/unable-install-add-ons-or-extensions -
> see the optionsPreferences line right after "To add the site to the trusted
> sites list:".

As far as I can tell, this is a content issue combined with a limitation of what we can with showfor.

if you look at the markup, you have two divs for showfor then a period outside the div. This period is forced to a new line, because that's how HTML works:

<li>
<div class="for" data-for="not fx29"><!-- content in here --></div>
<div class="for" data-for="fx29"><!-- content in here --></div>.
</li>

If you remove that last period, everything is good: http://cl.ly/image/0c2m3l2C1v3E

I'll submit a new revision for that.
(In reply to Kadir Topal [:atopal] from comment #0)
> When you include a template in an article that template is automatically
> appended with a space character for no apparent reason. From the source code
> it looks like we append templates with a line break. In any case, a
> following punctuation mark is preceded by a space character, which is wrong
> in many languages. 
> 
> Please remove that space.

Can you provide examples of this? or STR?
Flags: needinfo?(a.topal)
(In reply to Ricky Rosario [:rrosario, :r1cky] from comment #5)
> If you remove that last period, everything is good:
> http://cl.ly/image/0c2m3l2C1v3E

BTW, if you want the period back, you need to include inside the template and inside each showfor block
(In reply to Kadir Topal [:atopal] from comment #0)
> When you include a template in an article that template is automatically
> appended with a space character for no apparent reason. From the source code
> it looks like we append templates with a line break.

Looking at the example article provided in comment 3... If you do a View Source for the relevant section, you'll notice that the period that followed the template is right after the closing div of the template without any white-space:

<li> <div class="for" data-for="not fx29"><!-- I delete a bunch of content --></div>.
</li>


Given that, I am closing as WFM.

The issues that are happening are probably related to limitations of how we can include templates and how to use showfor within them.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(a.topal)
Resolution: --- → WORKSFORME
Michael, does this work for you?
removing sprint metadata.
Whiteboard: u=contributor c=wiki p= s=2014.3
(In reply to Kadir Topal [:atopal] from comment #9)
> Michael, does this work for you?

I'd characterize it more like, "I can live with that."
For info: I noticed that currently a space and a line break are inserted for Firefox articles, while it’s just a whitespace for TB articles. This seems odd, as their templates are about similar…

And, are you sure this should be a WFM? I mean, is it really impossible to fix? If so, I should get ready to fix a bunch of local articles adapting the template to include the period, and the same should happen for en-US. Of course, the 1 or 2 en-US articles that use the template preceding other text should be changed as well, if they still exist.
THere's a few questions remaining:

1) regarding the carriage return: the carriage return issue only shows up when using the optionsprefernces template. When using CloseOptionspreferences, only a space is added. Not usre if it’s worth investigating that?

2) At this time I think, not sure, it seems there are no active articles having occurrences of the OptionsPreferences template where they preceed other text within a sentence. As this bug concerns a general issue, all periods current versions shoulld have new revisions eliminating the periods and both the templates should include them. What action is required?
See https://support.mozilla.org/en-US/kb/Template%3Aoptionspreferences/discuss/2124 for discussion about steps still needed to be taken.
Meanwhile all KB artciles have been checked for (close)optionspreferences templates instances and stripped from their succeeding end stops in order to have them diplayed as they should.

Nevertheless and as asked above, I’d still like to know what causes the additonal line feed (/carriage return) in some cases, like occurred with the optionsPreferences tempate only, as we keep bumping in to this when using other templates calls such as closeFirefox or DisableHWAflash. Ricky, any idea where this line feed comes from and how to prevent it? Or is this simply unpredictable?
While we've made some revisions to manually work around this issue (i.e. moving the template so it's not at the end of the sentence), it's difficult to remember to keep doing that. We'd like to fix this space problem so we can use the templates without having to remember workarounds. Re-opening this bug.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
p3 seems right, this is super annoying but we have other higher priority bugs to fix
Status: REOPENED → RESOLVED
Closed: 10 years ago5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.