| /*=============================================================================# |
| # Copyright (c) 2015, 2018 David Green and others. |
| # |
| # This program and the accompanying materials are made available under the |
| # terms of the Eclipse Public License 2.0 which is available at |
| # https://www.eclipse.org/legal/epl-2.0. |
| # |
| # SPDX-License-Identifier: EPL-2.0 |
| # |
| # Contributors: |
| # David Green - org.eclipse.mylyn.docs: initial API and implementation |
| # Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation |
| #=============================================================================*/ |
| |
| package org.eclipse.statet.internal.docmlet.wikitext.commonmark.core.inlines; |
| |
| import org.eclipse.mylyn.wikitext.parser.DocumentBuilder; |
| |
| import org.eclipse.statet.internal.docmlet.wikitext.commonmark.core.CommonmarkLocator; |
| import org.eclipse.statet.internal.docmlet.wikitext.commonmark.core.Line; |
| import org.eclipse.statet.internal.docmlet.wikitext.commonmark.core.ProcessingContext; |
| |
| |
| public class HardLineBreak extends Inline { |
| |
| |
| public HardLineBreak(final Line line, final int offset, final int length, final int cursorLength) { |
| super(line, offset, length, cursorLength); |
| } |
| |
| |
| public char getType() { |
| final Line line= getLine(); |
| return line.getText().charAt(getStartOffset() - line.getStartOffset()); |
| } |
| |
| |
| @Override |
| public void emit(final ProcessingContext context, |
| final CommonmarkLocator locator, final DocumentBuilder builder) { |
| builder.lineBreak(); |
| } |
| |
| } |