Commit Graph

84 Commits

Author SHA1 Message Date
Aleks-Daniel Jakimenko
4eef4d2d76 No more /o, modifiers sorted alphabetically 2015-08-23 21:22:12 +03:00
Alex Schroeder
58e9a1e240 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Aleks-Daniel Jakimenko
a615bedccf Fixed a bunch of stuff 2015-04-28 00:03:11 +03:00
Aleks-Daniel Jakimenko
df87ff82c3 No more redundant 'package OddMuse;' 2015-04-27 17:41:59 +03:00
Aleks-Daniel Jakimenko
c7bd5617ff No more trailing whitespace 2015-04-17 01:39:47 +03:00
Aleks-Daniel Jakimenko
40ec24349a No more "*Sub = *NewSub", \&NewSub used instead. (Partial progress) 2015-04-11 23:41:33 +03:00
Aleks-Daniel Jakimenko
6f8d281d79 No more "use vars"! 2015-04-10 13:31:28 +03:00
Alex Schroeder
5ad5ad265a Make creole.pl use strict 2015-03-29 14:22:52 +02:00
Aleks-Daniel Jakimenko
4492ede096 "use strict;" in modules (some modules have problems) 2015-03-27 03:01:01 +02:00
Aleks-Daniel Jakimenko
62c7553d82 'return undef' changed to 'return'
This command was used:
find . -type f -print0 | xargs -0 sed -i 's/return undef/return/g'

The idea behind this commit is described on http://oddmuse.org/wiki/Refactoring page.
In short: 'return undef' returns (undef) in list context (a list with one element),
which is wrong.
2015-02-27 12:10:18 +02:00
IngoBelka
5997c3ea02 creole.pl: title-tag for images
This enables tooltips for images in FireFox and possibly in other browsers too
2014-09-13 14:55:38 +03:00
Alex Schroeder
5aba2ae56f Fixed typo in AddModuleDescription sub name 2014-08-21 22:23:23 +02:00
Alex Jakimenko
ee932dee37 Automatically reformatted modules 2014-08-21 07:29:46 +03:00
Alex Schroeder
a333fbf3b1 creole.pl: Fixed list item issues.
creole.t now runs again.
2014-08-06 11:01:15 +02:00
Alex Jakimenko
eb7de3c722 Allow mixed mode lists.
OpenHtmlEnvironment now accepts fourth parameter that defines similar
tags.

creole.pl now passes 'ol|ul' as fourth parameter to OpenHtmlEnvironment.

In addition to that, the creole.pl code was refactored a little bit to
remove copy-pasted part.
2014-08-05 22:59:17 +02:00
Alex Schroeder
4e790f7847 Fix justification of cells.
The code used to detect whitespace in sibling cells. Thus, if any of
the remaining cells on this line was centered or right justified, this
cell was also getting right justified. If the current cell was both
left and right justified, the result was that it got centered. Added a
test to check for this.
2013-03-05 23:07:23 +01:00
Alex Schroeder
37c32783f3 Changed \x{ffff} to \x{fffd} in all regular expressions.
Using Perl 5.8.8 resulted in a crash when compiling regular expressions referring to \x{ffff}.
2012-07-19 06:01:30 -04:00
Alex Schroeder
67650e3dc8 More UTF-8 fixes
All the source files containing non-ASCII characters needed to have
utf8 added. This will be necessary for user config files as well! The
regular expressions identifying page names had to be changed.
UrlEncode translates the string back to bytes before encoding it.
Cached RSS files are saved with UTF-8 encoding and therefore need
their meta-data changed (using the XML::RSS module to do this
correctly didn't work for some of the test files). The CGI object's
parameters, keywords and info_path are decoded correctly. File access
uses the UTF-8 layer (reading, writing, appending, access to the log
of recent changes, running sub processes with grep and diff).

The mac compatibility extension will also disable the use of grep if
non-ASCII characters are searched for because of an unexplained
problem with grep.
2012-05-24 18:08:42 +02:00
Alex Schroeder
f11e2a8731 getting rid of $Id$ tags in $WikiDescription
Replaced the $Id$ tags in $WikiDescription for all the modules and wiki.pl itself with a link to the source and an appropriate wiki page, if possible. This is shown in action=version and should help users figure out what another wiki has installed.
2012-04-19 02:18:45 +02:00
Alex Schroeder
75811218b4 Revert 2011-03-22 23:59:47 +00:00
Alex Schroeder
6ca7f3856f * creole.pl (CreoleRule): Remove emphasis rules (** and //)
(CreoleEmphasisRule): Moved to a different subroutine with a
different rule order.
(CreoleInit): Add CreoleEmphasisRule.
(CreoleRuleRecursive): Call it.
2011-03-22 23:42:18 +00:00
Alex Schroeder
13dd19703e (CreoleRule): Resolved a lot more quoting
issues using the ampersand.t tests.
2011-01-17 02:31:57 +00:00
Alex Schroeder
d142651249 (CreoleRule): Use FreeToNormal on the first
parameter to GetDownloadLink several times. When using
GetPageOrEditLink, make sure that we don't call NormalToFree on
the last parameter.
2011-01-16 03:36:15 +00:00
Alex Schroeder
1d69b8aeed (CreoleHeadingRule): Close HTML environment
before opening a header; this prevents headers insides p elements.
2010-02-20 21:00:57 +00:00
Alex Schroeder
a90de0f8c9 (CreoleRule): Fix bugs introduced by the last fix. 2009-03-02 18:09:48 +00:00
Alex Schroeder
3d5865363c (CreoleRule): Use an elsif instead of an if
within the rules.
2009-03-02 17:53:43 +00:00
Alex Schroeder
2df32424c3 (CreoleInit): Don't change $FreeLinkPattern as
that intereferes with bbcode.pl.
2008-12-16 01:17:43 +00:00
Brian Curry
451dac19bc * modules/creole.pl (CreoleRule): Implemented handling of so-called
"interlinks" -- i.e., links to external Wikis via the "$InterMap"
page. (So, Creole syntax is now embeddable within interlinks!)
2008-11-24 01:34:48 +00:00
Brian Curry
609cb49f86 * wiki.pl (PrintWikiToHTML): Slightly reordered function calls,
so as to optimize a few edge cases.
2008-11-16 01:00:04 +00:00
Brian Curry
52a47946a6 * wiki.pl (RegisterBlockLevelElement): Renamed to
SetHtmlEnvironmentContainer (and changed in every other module,
where called).
2008-11-15 21:24:32 +00:00
Brian Curry
7cfe623133 * wiki.pl (AddHtmlEnvironment): Corrected a minor regression.
Probably not a genuine issue... but one can never tell.
* modules/creole.pl (CloseHtmlEnvironmentsCreole): Removed.
* modules/creoleaddition.pl (CloseHtmlEnvironmentsCreoleAddition):
Removed.
* modules/poetry.pl (CloseHtmlEnvironmentsPoetry): Removed.
2008-11-15 12:53:25 +00:00
Brian Curry
b213cfb5a5 * modules/creole.pl (CreoleListAndNewLineRule): Corrected a regression
accidentally introduced by my last commit! Yay.
2008-11-11 23:58:24 +00:00
Brian Curry
4088200a99 * modules/creole.pl (CreoleRule): Corrected a horrific link-caching
issue with my last commit. Apologies to those who've already
installed the last commit: this one should be (substantially!) more
stable.
2008-11-10 15:53:22 +00:00
Brian Curry
0b38a69cd0 * modules/creole.pl (CreoleRule): Simplified implementation and
integrated with improvements to CreoleHeaderRule().
(CreoleHeaderRule): Improved -- remarkably. Header markup may now
include all other (non-bol) markup, with exception of link markup
producing a dirty HTML block. ("Dirty" link markup in header
markup is stripped out, as appropriate.)
(CreoleListAndNewlineRule): Simplified implementation.
(CreoleRuleRecursive): Supported the global @HtmlAttrStack.
(GetCreoleLinkHtml): New function, reducing code-bloat.
* modules/creoleaddition.pl (CreoleAdditionRule): Simplified
implementation; and handled small caps markup properly, now.
2008-11-06 10:11:02 +00:00
Brian Curry
9613b7608a * modules/wiki.pl (OpenHtmlEnvironment): Generalized list closure
by delegating that closure to the "CloseHtmlEnvironments" function.
This permits other extensions (namely, the Creole Markup extension)
to redefine the "CloseHtmlEnvironments" function and thereby
precisely override just when and how list markup is closed.
* modules/creole.pl ($CreoleDashStyleUnorderedLists): New option.
(RunMyRules): New function.
(CreoleRule): Improved conformance to the Wiki Creole standard by
strictly requiring, among other notable things, that horizontal
rules consist of four and only four dashes, that all image links
to images on the Wiki (e.g., image "FreeLinks") be marked as dirty
blocks, that the nowiki markup strictly require the opening and
closing three braces to reside on their own lines having no other
markup, and that preformatted code not extend over multiple blocks.
(CreoleListAndNewLineRule): Avoid handling dash-style unordered
list markup unless explicitly requested by the new
"$CreoleDashStyleUnorderedLists" option being set to 1 (since
that markup is non-standard, and explicitly contradicts the Wiki
Creole standard).
* t/creole.t: Adjusted tests broken by the above modifications;
these were, typically, tests for nowiki and preformatted markup
that assumed a less conformant, gentler handling of that markup.
2008-10-24 04:34:09 +00:00
Alex Schroeder
800c45834b (CreoleRule): Fix dirty block handling for the
[[page]] and [[page|text]] rules.
2008-10-06 22:51:50 +00:00
Brian Curry
514878af35 * modules/creole.pl (CreoleRule): Allow one newline character following an explicit pipe character to end a table. 2008-10-06 22:21:17 +00:00
Brian Curry
f583456681 * wiki.pl (ApplyRules): Ensure the regular expression match
position returns the length of the matched string on finishing
application of all rules. ("creole.pl" and "creoleaddition.pl" now
depend on this; it notifies them that rules are now finished.)
* modules/creoleaddition.pl (CreoleAdditionRule): Injected a sanity
check, to ensure closure of blockquotes at the end of a page.
* modules/creole.pl ($CreoleTableCellsAllowBlockLevelElements): New
option.
* modules/creole.pl (CreoleRule): The last, one hopes, of all Creole
table markup modifications (for the moment). The rather complex
table markup code has been modified so as to use the new option, has
been refactored for robustness and strict conformance to the Wiki
Creole standard, and has been well-documented.
* modules/creole.pl (CreoleGetTableHtmlAttributes): Deleted function.
2008-10-06 06:11:20 +00:00
Alex Schroeder
c8025e67af (CreoleRule): Added link around image for the
[[url|{{url}}]] rule.
2008-10-04 11:07:54 +00:00
Brian Curry
0fd92d4419 * modules/creole.pl (CreoleRuleRecursive): New function. Permits embedding
of Wiki Creole syntax within Wiki Creole syntax. (Yes... This is confusing?)
* modules/creole.pl (CreoleRule): Used the new function. Specifically, you
can now embed Creole and CreoleAddition syntax (such as bold, italics, small
caps, and so on) within URL and Wiki link text, ala
  "[[Some_Page|Wow! **Quite** an //%%interesting page%%// page, here]]."
* modules/creoleaddition.pl (CreoleAdditionRule): Renamed function from
"CreoleAdditionRules" to this.
2008-10-04 03:30:50 +00:00
Brian Curry
674cb60c3d * modules/creole.pl: "There be dragons, here." This module now
supports a significantly stabler, more robust syntax--including:
multiline table cells, block level elements in table cells, CSS
stylization for images and image links, simpler, more efficient
regular expressions, new perldoc-style documentation, and a subtle
slew of other bug fixes. "Huzzah!"
* modules/creoleaddition.pl (AddOrCloseCreoleAdditionEnvironment): New
function.
(CreoleAdditionRules): Usage of the new function.
* t/creole.pl: Corrected all non-XPath-dependent tests.
* t/creoleaddition.pl: Corrected all non-XPath-dependent tests.
2008-10-01 07:54:44 +00:00
Alex Schroeder
96af4f07fd (CreoleListRule): New. Added with a very late
priority.
(CreoleNewLineRule): Add two more newline oriented rule items and
moved priority even further back.
(CreoleRule): Removed list items and newline rules.
2008-07-12 15:27:54 +00:00
Alex Schroeder
409a1cdbf1 *** empty log message *** 2008-06-26 08:00:36 +00:00
Alex Schroeder
00b34f582c Updated to GPLv3 and added a separate copyright line for Weakish Jiang. 2008-06-26 07:56:47 +00:00
Weakish Jiang
964909e6e5 (CreoleHeadingRule): Better support on headings more than 6 levels 2008-06-25 15:03:28 +00:00
Weakish Jiang
b2bd42335b (CreoleRule): When CreoleLinebreaks set to 1, \\n won't produce extra br tags now. 2008-06-24 17:14:53 +00:00
Weakish Jiang
39987902db (CreoleNewLineRule): Avoid adding useless br tags in lists, etc. 2008-06-24 12:32:06 +00:00
Alex Schroeder
a468f786ca ($CreoleTildeAlternative): New option.
(CreoleRule): Added tilde proposal using $CreoleTildeAlternative.
2008-03-31 14:56:30 +00:00
Weakish Jiang
6612a1d738 * (CreoleHeadingRule): Change the match pattern for preformatted block
in order to conform Creole 1.0's standard. The actual RegExp change is
  provided from Alex Schröder.
2008-02-21 14:55:25 +00:00
Alex Schroeder
3911e29d26 (CreoleRule): The \n after {{{ is mandatory
for a pre block. Horizontal whitespace is allowed.
2007-10-23 09:33:38 +00:00