Skip to content

Commit

Permalink
Fix po2md not adding newline before first nested list lines (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja authored May 1, 2024
1 parent 3eb17ea commit 59cfd5a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
16 changes: 8 additions & 8 deletions docs/pre-commit-hooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ so you don't need to specify them.
.. code-block:: yaml
- repo: https://github.com/mondeja/mdpo
rev: v1.1.6
rev: v2.0.1
hooks:
- id: md2po
args:
Expand All @@ -32,7 +32,7 @@ so you don't need to specify them.
.. code-block:: yaml
- repo: https://github.com/mondeja/mdpo
rev: v1.1.6
rev: v2.0.1
hooks:
- id: md2po
files: ^README\.md
Expand All @@ -53,7 +53,7 @@ po2md
.. code-block:: yaml
- repo: https://github.com/mondeja/mdpo
rev: v1.1.6
rev: v2.0.1
hooks:
- id: po2md
args:
Expand All @@ -68,7 +68,7 @@ po2md
.. code-block:: yaml
- repo: https://github.com/mondeja/mdpo
rev: v1.1.6
rev: v2.0.1
hooks:
- id: po2md
files: ^README\.md
Expand All @@ -91,7 +91,7 @@ md2po2md
.. code-block:: yaml
- repo: https://github.com/mondeja/mdpo
rev: v1.1.6
rev: v2.0.1
hooks:
- id: md2po2md
args:
Expand All @@ -107,7 +107,7 @@ md2po2md
.. code-block:: yaml
- repo: https://github.com/mondeja/mdpo
rev: v1.1.6
rev: v2.0.1
hooks:
- id: md2po2md
files: ^README\.md
Expand All @@ -126,7 +126,7 @@ mdpo2html
.. code-block:: yaml
- repo: https://github.com/mondeja/mdpo
rev: v1.1.6
rev: v2.0.1
hooks:
- id: mdpo2html
args:
Expand All @@ -141,7 +141,7 @@ mdpo2html
.. code-block:: yaml
- repo: https://github.com/mondeja/mdpo
rev: v1.1.6
rev: v2.0.1
hooks:
- id: mdpo2html
files: ^README\.html
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mdpo"
version = "2.0.0"
version = "2.0.1"
description = "Markdown files translation using PO files."
readme = "README.md"
license = "BSD-3-Clause"
Expand Down
5 changes: 1 addition & 4 deletions src/mdpo/po2md/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,15 +586,12 @@ def leave_block(self, block, details):
if self._inside_quoteblock:
indent = ' ' * len(self._current_list_type)
self.current_line = f'{indent}{self.current_line}'
self._save_current_line()
elif self._inside_liblock_first_p:
self._inside_liblock_first_p = False
else:
indent = ' ' * len(self._current_list_type)
self.current_line = f'\n{indent}{self.current_line}'
self._save_current_line()
else:
self._save_current_line()
self._save_current_line()

self._inside_pblock = False
if self._inside_quoteblock:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
+ Otro elemento de lista desordenada anidado después de bloque de código
1. Elemento de lista ordenada
> Bloque de cita dentro de elemento de lista ordenada
> Otro bloque de cita dentro de elemento de lista ordenada
Expand All @@ -30,6 +31,7 @@
| Párrafo | Texto | Bar es | C es |
1. Elemento de lista ordenada anidado
> Otro bloque de cita anidado más dentro de elemento de lista ordenada anidado
> | Sintaxis | Descripción | Estilo | D es |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Otro elemento de lista
+ Elemento de lista desordenada
> Bloque de cita dentro de elemento de lista desordenada
> Otro bloque de cita dentro de elemento de lista desordenada
Expand All @@ -23,6 +24,7 @@
> Bloque de cita después de párrafo dentro de elemento de lista desordenada
- Elemento de lista desordenada anidado
> Otro bloque de cita más anidado dentro de elemento de lista desordenada anidado
| Sintaxis | Descripción | Estilo | A |
Expand Down

0 comments on commit 59cfd5a

Please sign in to comment.