Search

A new Extension, “MarkItUp!” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

This is a port of markItUp! to Symphony.

It comes with Markdown settings by default, but you can go to http://markitup.jaysalvat.com/downloads/ and get settings for other text formatters.

Known issues

  1. Code inside extension.driver.php has some ugly hacks to workaround some limitations in Symphony (which will be removed sooner or later). It could use some clean up also ;).

  2. There's no support for markItUp plugins yet. Only markup sets for now.

Warning

This extension directly reads (but not write) some of Symphony's database tables. Nothing bad happened while i was testing it, but backup your installation before trying it. Just to be on the safe side :).

Download

Woo! This has been on my to-do list for a while, so to see it working is awesome.

Good to hear it works for others too :). Thanks for report.

That's a nice editor. I'm going to check this out. Thanks!

Fixed pre-selecting last saved setting for field.

I might use this on all my future projects, it looks very promising!

I'm going to be using this in a website I'm working on since it's simpler than asking the client to write markdown, which they obviously wouldn't know.

Now, one issue I'm running into—and I apologize if this isn't the right place to ask this—is that I need a way for them to specify that it's a link to some other website as I'm treating those links differently than page-to-page links.

Any help on this?

dougoftheabaci, You can use XSLT for that:

<xsl:template match="a">
    <xsl:element name="a">
        <xsl:if test="@href">
                <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
        </xsl:if>
        <xsl:if test="@title">
                <xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
        </xsl:if>
        <xsl:choose>
            <xsl:when test="starts-with(@href, $root) or not(starts-with(@href, 'http://'))">
                <xsl:attribute name="class">local</xsl:attribute>
            </xsl:when>
            <xsl:otherwise>
                <xsl:attribute name="target">_blank</xsl:attribute>
                <xsl:attribute name="rel">nofollow</xsl:attribute>
            </xsl:otherwise>
        </xsl:choose>
        <xsl:value-of select="text()"/>
    </xsl:element>
</xsl:template>

Of course, You may want to improve it to handle links with images (or any other markup) inside of them, copy all attributes (not just href and title), improve check for local href (code above will treat URL as non-local if it does not start with $root or does not start with http, which means that any other protocol will be treated as local. best would be simple regex rule, but XSLT 1.0 does not have regular expressions :(, etc...

Sorry, I have another question. I'm running the Safari 4 Public Beta and I'm not seeing the format bar but I do in the latest release of Firefox.

I'm not sure what's causing the issue. Any thoughts?

I don't have Safari, so i can't test it :(.

Is there a space between field label and input field (like there were buttons, just not visible)?

Nope, it does not appear to be there at all. You can grab Safari here: http://www.apple.com/safari/

There's a Mac and PC version and their behavior is pretty much identical.

There's a Mac and PC version

You mean Mac and Windows version.

I'm using Linux (Ubuntu flavour), so no Safari for me. If You'll find out why it doesn't work let me know, or send pull request with patch on GitHub :).

The only error I can find is a parsing error for admin.js in Symphony. Maybe once Chrome gets released for Linux you can test there. Or you can use VirtualBox to run Windows and do browser testing there.

hmm... admin.js is not part of MarkItUp. Does that error show up even if You disable this extension?

I think I was reading the error log incorrectly. Yes the error goes away if I disable the plugin. Apparently the offending line is in this function:

$(document).ready(function() {
    $(".markItUp").each(function(){
        var formatter = this.className.match(markItUpFormattersRegex);
            if (!formatter[2]) return;
            formatter = formatter[2];

            var class = markItUpFormatters[formatter];

        if (class != "default") {
            myMarkItUpSettings[class].previewParserPath = "http://maclurelibrary.org/symphony/extension/markitup/preview/"+formatter+"/";
            myMarkItUpSettings[class].previewParserVar = "data";
        }
        $(this).markItUp(myMarkItUpSettings[class]);
    });
});

Specifically this line:

var class = markItUpFormatters[formatter];

Also, a request if I may for the next version would be definition lists. I've found the syntax for them here: http://michelf.com/projects/php-markdown/extra/#def-list

Also, an easy way to manage which options are shown. For instance, at no point should the author of my sites be putting in anything higher than an H3 so I'd like to disable H1 and H2 for those sections when possible.

Thanks for checking it dougoftheabaci. Can You try changing variable name form "class" to "type"?

Easy way to manage buttons is a nice idea. I'll think about adding some configuration page.

For now You can simply edit markitup/assets/markitup/sets/markdown/set.js file and add/remove stuff there.

I tried that but it just threw and error for the following line. Changing that threw yet more errors...

I've been looking around and found at least one WebKit browser for Linux, it's called Arora: http://code.google.com/p/arora/ There's also Midori: http://software.twotoasts.de/index.php?/pages/midori_summary.html

Also, Konqueror uses the KHTML engine which is similar to WebKit (apparently) but I can't test that on my Mac.

i'm not sure if Konqueror uses the same JS engine.

I have other two installed, plus Epiphany on WebKit, but they are hardly usable for JS debugging :(.

I'm going on vacations now, so i'll have more time for it when i come back.

@ahwayakchih: Have nice vacations! You have worked so hard for Symphony in the last weeks and months. Thank you for that.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details