All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.okapi.common.encoder.MarkdownEncoder Maven / Gradle / Ivy

There is a newer version: 1.46.0
Show newest version
package net.sf.okapi.common.encoder;

/**
 * The Markdown filter handles newlines itself, so encoder is a no-op.
 * @depreacated Use of this is most likely the cause of issue #820.
 */
 @Deprecated // Fixing issue #820. This class is most likely unnecessary. Remove it later.
public class MarkdownEncoder extends DefaultEncoder {

    @Override
    public String encode (String text,
            EncoderContext context)
    {
        return text;
    }

    @Override
    public String encode (char value,
            EncoderContext context)
    {
        return String.valueOf(value);
    }

    @Override
    public String encode (int value,
            EncoderContext context)
    {
        if ( Character.isSupplementaryCodePoint(value) ) {
            return new String(Character.toChars(value));
        }
        return String.valueOf((char)value); 
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy